Skip to content
Snippets Groups Projects
Commit 6292aa57 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Check if web root has already been appended

parent 65e3f634
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.
Finish editing this message first!
Please register or to comment