Page MenuHomePhorge

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

Authored by aklapper on May 6 2023, 22:59.
Tags
None
Referenced Files
F3253690: D25201.1742438845.diff
Wed, Mar 19, 02:47
F3220993: D25201.1741813309.diff
Tue, Mar 11, 21:01
F3220992: D25201.1741813305.diff
Tue, Mar 11, 21:01
F3172579: D25201.1741281085.diff
Wed, Mar 5, 17:11
F3011036: D25201.1740655560.diff
Wed, Feb 26, 11:26
F3011033: D25201.1740655558.diff
Wed, Feb 26, 11:25
F3011025: D25201.1740655341.diff
Wed, Feb 26, 11:22
F3011005: D25201.1740654514.diff
Wed, Feb 26, 11:08

Details

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 T15363

Test Plan

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

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.May 6 2023, 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.May 8 2023, 10:00