Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception in Feed setting up MFA
Needs ReviewPublic

Authored by aklapper on Mon, Feb 10, 11:57.
Tags
None
Referenced Files
F2994560: D25867.1740317139.diff
Sat, Feb 22, 13:25
F2992700: D25867.1740243267.diff
Fri, Feb 21, 16:54
F2991667: D25867.1740196472.diff
Fri, Feb 21, 03:54
F2991608: D25867.1740195048.diff
Fri, Feb 21, 03:30
F2987313: D25867.1740112475.diff
Thu, Feb 20, 04:34
F2985473: D25867.1740055075.diff
Wed, Feb 19, 12:37
F2985459: D25867.1740053415.diff
Wed, Feb 19, 12:10
F2981720: D25867.1739925541.diff
Tue, Feb 18, 00:39

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/xaction/PhabricatorAuthFactorProviderNameTransaction.php:20]

Closes T15992

Test Plan

After applying the changes, go to http://phorge.localhost/feed/transactions/ and check the entries related to setting up an MFA provider.

Diff Detail

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