@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 Maniphest task creation 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 T15302

Test Plan:
Applied these five changes (on top of D25144, D25145, D25146, D25147, D25151)
and `/maniphest/task/edit/form/default/` 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: T15302

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

+5 -5
+3 -3
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 971 971 } 972 972 973 973 $page_key = $request->getURIData('pageKey'); 974 - if (!strlen($page_key)) { 974 + if (!phutil_nonempty_string($page_key)) { 975 975 $pages = $this->getPages($object); 976 976 if ($pages) { 977 977 $page_key = head_key($pages); 978 978 } 979 979 } 980 980 981 - if (strlen($page_key)) { 981 + if (phutil_nonempty_string($page_key)) { 982 982 $page = $this->selectPage($object, $page_key); 983 983 if (!$page) { 984 984 return new Aphront404Response(); ··· 1169 1169 if ($this->getIsCreate()) { 1170 1170 $template = $request->getStr('template'); 1171 1171 1172 - if (strlen($template)) { 1172 + if (phutil_nonempty_string($template)) { 1173 1173 $template_object = $this->newObjectFromIdentifier( 1174 1174 $template, 1175 1175 array(
+1 -1
src/applications/transactions/editfield/PhabricatorEditField.php
··· 418 418 } 419 419 420 420 $instructions = $this->getControlInstructions(); 421 - if (strlen($instructions)) { 421 + if (phutil_nonempty_string($instructions)) { 422 422 $form->appendRemarkupInstructions($instructions); 423 423 } 424 424
+1 -1
src/applications/transactions/editfield/PhabricatorTextEditField.php
··· 18 18 $control = new AphrontFormTextControl(); 19 19 20 20 $placeholder = $this->getPlaceholder(); 21 - if (strlen($placeholder)) { 21 + if (phutil_nonempty_string($placeholder)) { 22 22 $control->setPlaceholder($placeholder); 23 23 } 24 24