Skip to content

Commit 747d7db

Browse files
committed
Fix a PHP 8.1/8.2 deprecated use of ltrim and rtrim with a NULL argument
Summary: These calls were preventing notification servers configuration to be properly initialized. Indeed, PHP 8.X is stricter concerning This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement. Fix T15598 Test Plan: Sign in as an administrator, configure the notification server without filling admin path field, you shouldn't get both an RuntimeException and a warning indicating that Phorge is unable to connect to Notification Server but a message indicating that everything is fine. Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey Subscribers: avivey, Cigaryno, Matthew, valerio.bozzolan, tobiaswiese, speck Maniphest Tasks: T15598 Differential Revision: https://we.phorge.it/D25382
1 parent 17befe9 commit 747d7db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/applications/notification/client/PhabricatorNotificationServerRef.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ public function isAdminServer() {
143143
return ($this->type == 'admin');
144144
}
145145

146-
public function getURI($to_path = null) {
147-
$full_path = rtrim($this->getPath(), '/').'/'.ltrim($to_path, '/');
146+
public function getURI($to_path = '') {
147+
$path = coalesce($this->path, '');
148+
$to_path = coalesce($to_path, '');
149+
$full_path = rtrim($path, '/').'/'.ltrim($to_path, '/');
148150

149151
$uri = id(new PhutilURI('http://'.$this->getHost()))
150152
->setProtocol($this->getProtocol())

0 commit comments

Comments
 (0)