From 7f46a252f21e6dc21caba593440db4da13684dab Mon Sep 17 00:00:00 2001 From: bob Date: Fri, 18 Aug 2023 09:19:42 +0200 Subject: [PATCH] Fix a PHP 8.1/8.2 deprecated use of strlen a NULL argument Summary: This commit harmonizes PhabricatorNotificationServerRef's getURI and getWebsocketURI methods as discussed in D25382. Test Plan: This is hard to say since I didn't know how/when this function might be called. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25401 --- .../notification/client/PhabricatorNotificationServerRef.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/notification/client/PhabricatorNotificationServerRef.php b/src/applications/notification/client/PhabricatorNotificationServerRef.php index 03cd5de5d4..2fe903fdba 100644 --- a/src/applications/notification/client/PhabricatorNotificationServerRef.php +++ b/src/applications/notification/client/PhabricatorNotificationServerRef.php @@ -161,9 +161,9 @@ final class PhabricatorNotificationServerRef return $uri; } - public function getWebsocketURI($to_path = null) { + public function getWebsocketURI($to_path = '') { $instance = PhabricatorEnv::getEnvConfig('cluster.instance'); - if (strlen($instance)) { + if (phutil_nonempty_string($instance)) { $to_path = $to_path.'~'.$instance.'/'; }