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
F2163798: D25201.id690.diff
Thu, Apr 25, 14:57
F2163795: D25201.id678.diff
Thu, Apr 25, 14:57
F2163759: D25201.id.diff
Thu, Apr 25, 14:41
F2163738: D25201.diff
Thu, Apr 25, 14:31
Unknown Object (File)
Thu, Apr 11, 14:40
Unknown Object (File)
Thu, Apr 11, 13:52
Unknown Object (File)
Thu, Apr 11, 03:49
Unknown Object (File)
Wed, Apr 10, 22:53

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