Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception in PhabricatorAuthAccountView
ClosedPublic

Authored by aklapper on Aug 2 2024, 13:35.
Tags
None
Referenced Files
F2977764: D25761.1739653306.diff
Fri, Feb 14, 21:01
F2977763: D25761.1739653305.diff
Fri, Feb 14, 21:01
F2977722: D25761.1739649489.diff
Fri, Feb 14, 19:58
F2977698: D25761.1739645033.diff
Fri, Feb 14, 18:43
F2951832: D25761.1738942870.diff
Feb 6 2025, 15:41
F2932472: D25761.1737736444.diff
Jan 23 2025, 16:34
F2895139: D25761.1737233962.diff
Jan 17 2025, 20:59
F2874999: D25761.1736968283.diff
Jan 14 2025, 19:11

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/view/PhabricatorAuthAccountView.php:66]

Closes T15900

Test Plan

Try to register an account via LDAP.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable