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
F3821465: D25867.1746020670.diff
Tue, Apr 29, 13:44
F3818416: D25867.1746016570.diff
Tue, Apr 29, 12:36
F3749308: D25867.1745795458.diff
Sat, Apr 26, 23:10
F3711903: D25867.1745663211.diff
Fri, Apr 25, 10:26
F3695611: D25867.1745594354.diff
Thu, Apr 24, 15:19
F3681915: D25867.1745563049.diff
Thu, Apr 24, 06:37
F3681871: D25867.1745562138.diff
Thu, Apr 24, 06:22
F3675367: D25867.1745508783.diff
Wed, Apr 23, 15:33

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