@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 Auth's Customize Messages 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 T15325

Test Plan: Applied these three changes and all seven subpages (e.g. `/auth/message/user.edit.username/`) 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: T15325

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

+3 -3
+3 -3
src/applications/auth/controller/message/PhabricatorAuthMessageViewController.php
··· 103 103 ->setViewer($viewer); 104 104 105 105 $full_description = $message_type->getFullDescription(); 106 - if (strlen($full_description)) { 106 + if (phutil_nonempty_string($full_description)) { 107 107 $view->addTextContent(new PHUIRemarkupView($viewer, $full_description)); 108 108 } else { 109 109 $short_description = $message_type->getShortDescription(); ··· 111 111 } 112 112 113 113 $message_text = $message->getMessageText(); 114 - if (strlen($message_text)) { 114 + if (phutil_nonempty_string($message_text)) { 115 115 $view->addSectionHeader( 116 116 pht('Message Preview'), 117 117 PHUIPropertyListView::ICON_SUMMARY); ··· 120 120 } 121 121 122 122 $default_text = $message_type->getDefaultMessageText(); 123 - if (strlen($default_text)) { 123 + if (phutil_nonempty_string($default_text)) { 124 124 $view->addSectionHeader( 125 125 pht('Default Message'), 126 126 PHUIPropertyListView::ICON_SUMMARY);