diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2014-02-07 17:39:19 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2014-02-07 17:39:19 +0100 |
commit | 2ff0d3a2552ea18e6e73a9de9332f89f723a1495 (patch) | |
tree | 3f84c013e72a0f953d1f07a7e63b6d7a8d5b7beb /lib | |
parent | 5f610a1cbc5a97bd4f097111536516f547a94fda (diff) | |
download | nextcloud-server-2ff0d3a2552ea18e6e73a9de9332f89f723a1495.tar.gz nextcloud-server-2ff0d3a2552ea18e6e73a9de9332f89f723a1495.zip |
Test if $url is already prefixed by '/'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/urlgenerator.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index e618aef268a..60da34f2d6e 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -147,6 +147,7 @@ class URLGenerator implements IURLGenerator { * @return string the absolute version of the url */ public function getAbsoluteURL($url) { - return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . '/' . $url; + $separator = $url[0] === '/' ? '' : '/'; + return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . $separator . $url; } } |