Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks rendering Config's Module page
ClosedPublic

Authored by aklapper on Apr 30 2023, 12:25.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 12:18
Unknown Object (File)
Thu, Apr 11, 07:41
Unknown Object (File)
Sat, Apr 6, 07:45
Unknown Object (File)
Mon, Apr 1, 01:24
Unknown Object (File)
Sun, Mar 31, 03:09
Unknown Object (File)
Sat, Mar 30, 09:17
Unknown Object (File)
Sat, Mar 30, 03:32
Unknown Object (File)
Sat, Mar 30, 03:17

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 T15308

Test Plan

Applied this change (on top of D25144, D25145, D25146, D25147, D25150,
D25151, D25152, D25153, D25154, D25155) and /config/module/ rendered
in web browser.

T15308

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

valerio.bozzolan added inline comments.
src/applications/config/controller/module/PhabricatorConfigModuleController.php
12

✅ The $key is NULL as default for the page /config/module/ - and it's a string like "hovercardengine" for the page /config/module/hovercardengine/ etc. so it's the valid domain for phutil_nonempty_string().

Alien values will be reported and that is OK.

This revision is now accepted and ready to land.Apr 30 2023, 12:28