Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks rendering Configuration's Settings page

Authored by aklapper on May 1 2023, 21:18.
Referenced Files
Unknown Object (File)
Wed, May 31, 06:31
Unknown Object (File)
Thu, May 18, 13:03
Unknown Object (File)
Wed, May 17, 22:59
Unknown Object (File)
Tue, May 16, 04:16
Unknown Object (File)
Fri, May 12, 12:02



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 T15324

Test Plan

Applied this change and /config/settings/ rendered in web browser.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.May 1 2023, 21:18
aklapper retitled this revision from Fix PHP 8.1 "strlen(null)" exception[s] which block rendering Configuration's Settings page to Fix PHP 8.1 "strlen(null)" exception which blocks rendering Configuration's Settings page.May 1 2023, 22:58

Tested locally following the test plan. No implosions. This Thanks!



✅ I tracked $filter with phlog() and it assumes values like "advanced" or "all" or null and it's not indented to assume other types. You can have a proof of that also looking at the below lines.

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

This revision is now accepted and ready to land.May 2 2023, 20:39