Page MenuHomePhorge

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

Authored by aklapper on Feb 10 2025, 11:57.
Tags
None
Referenced Files
F3553911: D25867.1744963163.diff
Thu, Apr 17, 07:59
F3530344: D25867.1744872944.diff
Wed, Apr 16, 06:55
F3388129: D25867.1744444871.diff
Fri, Apr 11, 08:01
F3388128: D25867.1744444865.diff
Fri, Apr 11, 08:01
F3377484: D25867.1744341453.diff
Thu, Apr 10, 03:17
F3364632: D25867.1744158329.diff
Tue, Apr 8, 00:25
F3342815: D25867.1743669824.diff
Wed, Apr 2, 08:43
F3304300: D25867.1743096105.diff
Wed, Mar 26, 17:21

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable