diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2014-02-07 20:39:19 +0400 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2014-02-07 20:39:19 +0400 |
commit | 2ff0d3a2552ea18e6e73a9de9332f89f723a1495 (patch) | |
tree | 3f84c013e72a0f953d1f07a7e63b6d7a8d5b7beb /lib/private/urlgenerator.php | |
parent | 5f610a1cbc5a97bd4f097111536516f547a94fda (diff) |
Test if $url is already prefixed by '/'
Diffstat (limited to 'lib/private/urlgenerator.php')
-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; } } |