Page MenuHomePhorge

PHP 8.2 : rtrim(): Passing null to parameter #1 ($string) of type string is deprecated when checking notification servers
Closed, ResolvedPublic

Description

After fixing T15596 via D25381, I got another regression, here is the stacktrace :

PHP message: [2023-08-09 16:42:02] EXCEPTION: (RuntimeException) rtrim(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]; 
PHP message: arcanist(head=master, ref.master=6e4947b55f09), phorge(head=master, ref.master=faa9da9e566d); 
PHP message:   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]; 
PHP message:   #1 <#2> rtrim(NULL, string) called at [<phorge>/src/applications/notification/client/PhabricatorNotificationServerRef.php:154]; 
PHP message:   #2 <#2> PhabricatorNotificationServerRef::getURI(string) called at [<phorge>/src/applications/notification/client/PhabricatorNotificationServerRef.php:217]; PHP message:   #3 <#2> PhabricatorNotificationServerRef::loadServerStatus() called at [<phorge>/src/applications/notification/client/PhabricatorNotificationClient.php:13]; PHP message:   #4 <#2> PhabricatorNotificationClient::tryAnyConnection() called at [<phorge>/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php:7]; 
PHP message:   #5 phlog(RuntimeException) called at [<phorge>/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php:10]; 
PHP message:   #6 PhabricatorAphlictSetupCheck::executeChecks() called at [<phorge>/src/applications/config/check/PhabricatorSetupCheck.php:63]; 
PHP message:   #7 PhabricatorSetupCheck::runSetupChecks() called at [<phorge>/src/applications/config/check/PhabricatorSetupCheck.php:258]; 
PHP message:   #8 PhabricatorSetupCheck::runNormalChecks() called at [<phorge>/src/applications/config/engine/PhabricatorSetupEngine.php:26]; 
PHP message:   #9 PhabricatorSetupEngine::execute() called at [<phorge>/src/applications/config/controller/issue/PhabricatorConfigIssueViewController.php:11];

based on these information, I guess this one will be easy to address. I'll propose a fix tomorrow.

Here is a screenshot of the issue :

{F329142}