Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception[s] which block rendering "Browse Projects" overlay dialog

Authored by aklapper on Wed, May 10, 14:27.
Referenced Files
Unknown Object (File)
Wed, May 31, 06:42
Unknown Object (File)
Sat, May 27, 22:31
Unknown Object (File)
Fri, May 26, 21:44
Unknown Object (File)
Fri, May 26, 07:51
Unknown Object (File)
Tue, May 23, 16:32



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 T15380

Test Plan

Applied these two changes (on top of D25179) and on the task creation page, after clicking the magnifier icon in the "Tags" field, the "Browse Projects" overlay dialog got rendered.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

aklapper edited the test plan for this revision. (Show Details)

Thanks (again)

I tested this patch locally following the test plan. No implosions.

Also tested with various Typehead like Subscribers.



✅ I verified that the above line just contains a string (or maybe null for some weird cases).

The function phutil_nonempty_string() will report alien types (like objects), and that is OK.


✅ Same as above

This revision is now accepted and ready to land.Thu, May 11, 16:53

To other reviewers: the related lint errors will be fixed also thanks to aklapper: D25209