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
F2195688: D25201.1716148701.diff
Sat, May 18, 19:58
Unknown Object (File)
Wed, May 8, 20:37
Unknown Object (File)
Wed, May 8, 15:18
Unknown Object (File)
Wed, May 8, 15:18
Unknown Object (File)
Wed, May 8, 15:18
Unknown Object (File)
Wed, May 8, 13:56
Unknown Object (File)
Tue, May 7, 10:22
Unknown Object (File)
Sun, May 5, 18:14

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
Branch
phortuneAccDet (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 373
Build 373: arc lint + arc unit

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