Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception for "/bin/auth refresh" without parameter
ClosedPublic

Authored by aklapper on Apr 16 2024, 08:36.
Tags
None
Referenced Files
F3220977: D25583.1741813284.diff
Tue, Mar 11, 21:01
F3220976: D25583.1741813283.diff
Tue, Mar 11, 21:01
F3148494: D25583.1741217879.diff
Tue, Mar 4, 23:37
F3079523: D25583.1741064079.diff
Mon, Mar 3, 04:54
F2976238: D25583.1739586767.diff
Fri, Feb 14, 02:32
F2976235: D25583.1739586763.diff
Fri, Feb 14, 02:32
F2962755: D25583.1739181885.diff
Feb 9 2025, 10:04
F2962754: D25583.1739181882.diff
Feb 9 2025, 10:04

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.

ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php:37]
Test Plan

Run ../phorge/bin/auth refresh: Get no strlen() error anymore but only expected output Found 3 account(s) to refresh. (or similar)

Diff Detail

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