From 2da7594344c92ca998f83d25793123baf2c61668 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 10 Aug 2023 17:36:18 +0200 Subject: [PATCH] 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 --- .../config/PhabricatorNotificationServersConfigType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/notification/config/PhabricatorNotificationServersConfigType.php b/src/applications/notification/config/PhabricatorNotificationServersConfigType.php index f13105a249..8fbac5806c 100644 --- a/src/applications/notification/config/PhabricatorNotificationServersConfigType.php +++ b/src/applications/notification/config/PhabricatorNotificationServersConfigType.php @@ -92,7 +92,7 @@ final class PhabricatorNotificationServersConfigType } $path = idx($spec, 'path'); - if ($type == 'admin' && strlen($path)) { + if ($type == 'admin' && phutil_nonempty_string($path)) { throw $this->newException( pht( 'Notification server configuration describes an invalid host '.