Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks rendering Phortune account page

Authored by aklapper on Sat, May 6, 22:59.
Referenced Files
Unknown Object (File)
Wed, May 31, 06:39
Unknown Object (File)
Wed, May 24, 00:11
Unknown Object (File)
Tue, May 23, 21:53
Unknown Object (File)
Mon, May 22, 08:11
Unknown Object (File)
Wed, May 17, 10:13



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 T15363

Test Plan

Applied this change and "Default Account" page /phortune/account/1/details/ rendered in web browser.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.Sat, May 6, 22:59

Thanks again

Tested locally without implosions. I also tried renaming an account.

The function phutil_nonempty_string() will report any alien value that is not NULL or a string, and that is OK.

This revision is now accepted and ready to land.Mon, May 8, 10:00