Check if web root has already been appended
This commit is contained in:
parent
65e3f63400
commit
6292aa57af
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue