Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exceptions creating an OAuth provider
ClosedPublic

Authored by aklapper on Aug 11 2024, 21:00.
Tags
None
Referenced Files
F3552833: D25771.1744909030.diff
Wed, Apr 16, 16:57
F3496561: D25771.1744790244.diff
Tue, Apr 15, 07:57
F3407933: D25771.1744592913.diff
Sun, Apr 13, 01:08
F3389988: D25771.1744462464.diff
Fri, Apr 11, 12:54
F3387564: D25771.1744438328.diff
Fri, Apr 11, 06:12
F3384220: D25771.1744401612.diff
Thu, Apr 10, 20:00
F3372146: D25771.1744248678.diff
Wed, Apr 9, 01:31
F3371888: D25771.1744246701.diff
Wed, Apr 9, 00:58

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/provider/PhabricatorOAuth1AuthProvider.php:163]
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/provider/PhabricatorOAuth1AuthProvider.php:178]
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/provider/PhabricatorOAuthAuthProvider.php:147]

Closes T15912

Test Plan

As an admin, create an OAuth provider (such as using Bitbucket) and check the error logs or Dark Console.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable