@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 numerous PHP 8.1 "strlen(null)" exceptions trying access Configuration 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 your phutil_nonempty_string() throws an exception, just
report it to Phorge to evaluate and fix together that specific corner case.

Closes T15287

Test Plan: Applied these three changes and `/config/` 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: T15287

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

+3 -3
+2 -2
src/applications/config/controller/PhabricatorConfigConsoleController.php
··· 85 85 $rows = array(); 86 86 foreach ($versions as $name => $info) { 87 87 $branchpoint = $info['branchpoint']; 88 - if (strlen($branchpoint)) { 88 + if (phutil_nonempty_string($branchpoint)) { 89 89 $branchpoint = substr($branchpoint, 0, 12); 90 90 } else { 91 91 $branchpoint = null; 92 92 } 93 93 94 94 $version = $info['hash']; 95 - if (strlen($version)) { 95 + if (phutil_nonempty_string($version)) { 96 96 $version = substr($version, 0, 12); 97 97 } else { 98 98 $version = pht('Unknown');
+1 -1
src/view/control/AphrontTableView.php
··· 135 135 136 136 $col_classes = array(); 137 137 foreach ($this->columnClasses as $key => $class) { 138 - if (strlen($class)) { 138 + if (phutil_nonempty_string($class)) { 139 139 $col_classes[] = $class; 140 140 } else { 141 141 $col_classes[] = null;