Page MenuHomePhorge

D25382.1737413575.diff
No OneTemporary

D25382.1737413575.diff

diff --git a/src/applications/notification/client/PhabricatorNotificationServerRef.php b/src/applications/notification/client/PhabricatorNotificationServerRef.php
--- a/src/applications/notification/client/PhabricatorNotificationServerRef.php
+++ b/src/applications/notification/client/PhabricatorNotificationServerRef.php
@@ -144,7 +144,13 @@
}
public function getURI($to_path = null) {
- $full_path = rtrim($this->getPath(), '/').'/'.ltrim($to_path, '/');
+ $full_path = '/';
+ if (phutil_nonempty_string($this->getPath())) {
+ $full_path = rtrim($this->getPath(), '/').$full_path;
+ }
+ if (phutil_nonempty_string($to_path)) {
+ $full_path = $full_path.ltrim($to_path, '/');
+ }
$uri = id(new PhutilURI('http://'.$this->getHost()))
->setProtocol($this->getProtocol())
diff --git a/src/applications/notification/config/PhabricatorNotificationServersConfigType.php b/src/applications/notification/config/PhabricatorNotificationServersConfigType.php
--- a/src/applications/notification/config/PhabricatorNotificationServersConfigType.php
+++ b/src/applications/notification/config/PhabricatorNotificationServersConfigType.php
@@ -92,7 +92,7 @@
}
$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 '.
diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php
--- a/src/applications/search/controller/PhabricatorSearchController.php
+++ b/src/applications/search/controller/PhabricatorSearchController.php
@@ -13,7 +13,7 @@
$viewer = $this->getViewer();
$query = $request->getStr('query');
- if ($request->getStr('jump') != 'no' && strlen($query)) {
+ if ($request->getStr('jump') != 'no' && phutil_nonempty_string($query)) {
$jump_uri = id(new PhabricatorDatasourceEngine())
->setViewer($viewer)
->newJumpURI($query);

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 20, 22:52 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1140495
Default Alt Text
D25382.1737413575.diff (2 KB)

Event Timeline