diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2014-03-31 14:24:38 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2014-03-31 14:24:38 +0200 |
commit | 6292aa57af8900f38885e9bb08b748a80d86aec1 (patch) | |
tree | de442c1d2b011514f659343ffcbcfd20867f3863 /lib/private/urlgenerator.php | |
parent | 65e3f634000a2142f412b85d0443f241bb64a9ab (diff) | |
download | nextcloud-server-6292aa57af8900f38885e9bb08b748a80d86aec1.tar.gz nextcloud-server-6292aa57af8900f38885e9bb08b748a80d86aec1.zip |
Check if web root has already been appended
Diffstat (limited to 'lib/private/urlgenerator.php')
-rw-r--r-- | lib/private/urlgenerator.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index 0d238737dde..260eeb15108 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -149,6 +149,11 @@ class URLGenerator implements IURLGenerator { public function getAbsoluteURL($url) { $separator = $url[0] === '/' ? '' : '/'; - return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost(). \OC::$WEBROOT . $separator . $url; + // The ownCloud web root can already be prepended. + $webRoot = substr($url, 0, strlen(\OC::$WEBROOT)) === \OC::$WEBROOT + ? '' + : \OC::$WEBROOT; + + return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost(). $webRoot . $separator . $url; } } |