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
F2941254: D25201.1738105841.diff
Mon, Jan 27, 23:10
F2941253: D25201.1738105841.diff
Mon, Jan 27, 23:10
F2938162: D25201.1737974880.diff
Sun, Jan 26, 10:48
F2936737: D25201.1737938225.diff
Sun, Jan 26, 00:37
F2936687: D25201.1737935570.diff
Sat, Jan 25, 23:52
F2935745: D25201.1737867423.diff
Sat, Jan 25, 04:57
F2935584: D25201.1737856943.diff
Sat, Jan 25, 02:02
F2869823: D25201.1736737150.diff
Sun, Jan 12, 02:59

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