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.

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