@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix PHP 8.1 "strlen(null)" exceptions which block rendering the Conpherence page

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

Closes T15304

Test Plan:
Applied these four changes (on top of `D25144`, `D25145`, `D25146`, `D25147`, `D25150`,
`D25151`, `D25152`, `D25153`) and `/conpherence/` page finally rendered in web browser.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15304

Differential Revision: https://we.phorge.it/D25154

+5 -4
+4 -3
src/applications/conpherence/query/ConpherenceThreadQuery.php
··· 135 135 } 136 136 137 137 protected function buildGroupClause(AphrontDatabaseConnection $conn_r) { 138 - if ($this->participantPHIDs !== null || strlen($this->fulltext)) { 138 + if ($this->participantPHIDs !== null || 139 + phutil_nonempty_string($this->fulltext)) { 139 140 return qsprintf($conn_r, 'GROUP BY thread.id'); 140 141 } else { 141 142 return $this->buildApplicationSearchGroupClause($conn_r); ··· 152 153 id(new ConpherenceParticipant())->getTableName()); 153 154 } 154 155 155 - if (strlen($this->fulltext)) { 156 + if (phutil_nonempty_string($this->fulltext)) { 156 157 $joins[] = qsprintf( 157 158 $conn, 158 159 'JOIN %T idx ON idx.threadPHID = thread.phid', ··· 234 235 $this->participantPHIDs); 235 236 } 236 237 237 - if (strlen($this->fulltext)) { 238 + if (phutil_nonempty_string($this->fulltext)) { 238 239 $where[] = qsprintf( 239 240 $conn, 240 241 'MATCH(idx.corpus) AGAINST (%s IN BOOLEAN MODE)',
+1 -1
src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
··· 106 106 $engines = array(); 107 107 108 108 $fulltext = $query->getParameter('fulltext'); 109 - if (strlen($fulltext) && $conpherences) { 109 + if (phutil_nonempty_string($fulltext) && $conpherences) { 110 110 $context = $this->loadContextMessages($conpherences, $fulltext); 111 111 112 112 $author_phids = array();