Skip to content
Snippets Groups Projects
Commit a94ac415 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #7966 from owncloud/url_generation_hack

Check if web root has already been appended
parents 7a4a836a 6292aa57
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment