Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks Space creation
ClosedPublic

Authored by aklapper on May 4 2023, 11:29.

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 T15340

Test Plan

Applied this change and page /S3 rendered in web browser.

Diff Detail

Repository
rP Phorge
Branch
createSpace (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 354
Build 354: arc lint + arc unit

Event Timeline

aklapper requested review of this revision.May 4 2023, 11:29

Thanks for this patch, again

I tested this patch locally. I was able to create a Space, rename a Space, etc., without any nuclear implosion.

Thanks

Green light

yesyes

src/applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php
18

✅ The value $old always is NULL at startup, or is a string after a rename.

The function phutil_nonempty_string() will report any alien type, and that is OK.

This revision is now accepted and ready to land.May 5 2023, 19:54