summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-04-01 10:59:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-04-01 10:59:53 +0200
commita94ac41512ecffd9bb3ef659d3457b8af12d2306 (patch)
treed2233b6512ef9cb62ae958797c81e0ddeaa021c3
parent7a4a836abe2cce89df92648a39cd9e2cd3fae1de (diff)
parent6292aa57af8900f38885e9bb08b748a80d86aec1 (diff)
downloadnextcloud-server-a94ac41512ecffd9bb3ef659d3457b8af12d2306.tar.gz
nextcloud-server-a94ac41512ecffd9bb3ef659d3457b8af12d2306.zip
Merge pull request #7966 from owncloud/url_generation_hack
Check if web root has already been appended
-rw-r--r--lib/private/urlgenerator.php7
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;
}
}