1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Fix a PHP 8.1/8.2 deprecated call to strlen with a NULL argument

Summary:
This call was preventing notification servers configuration to be properly initialized.
Indeed, 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.

Fix T15596

Test Plan:
Sign in as an administrator, configure the notification server without filling admin path field,
you shouldn't get an invalid configuration error

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15596

Differential Revision: https://we.phorge.it/D25381
This commit is contained in:
root 2023-08-10 17:36:18 +02:00 committed by bob
parent 226f315093
commit 2da7594344

View file

@ -92,7 +92,7 @@ final class PhabricatorNotificationServersConfigType
} }
$path = idx($spec, 'path'); $path = idx($spec, 'path');
if ($type == 'admin' && strlen($path)) { if ($type == 'admin' && phutil_nonempty_string($path)) {
throw $this->newException( throw $this->newException(
pht( pht(
'Notification server configuration describes an invalid host '. 'Notification server configuration describes an invalid host '.