[Pkg-owncloud-commits] [owncloud] 34/70: Only calculate the WEBROOT from scriptName if it contains $SUBURI
David Prévot
taffit at moszumanska.debian.org
Mon Jul 14 17:38:06 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit dccab5d20fd99e30b5003a2af471bf0e24b96c53
Author: Joas Schilling <nickvergessen at gmx.de>
Date: Mon Jul 7 15:01:02 2014 +0200
Only calculate the WEBROOT from scriptName if it contains $SUBURI
If not we are most likely in CLI mode. However to be able to still
generate valid URLs, we need to use the overwrite webroot instead.
Fix #9490
---
lib/base.php | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/lib/base.php b/lib/base.php
index b526840..840d904 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -117,10 +117,18 @@ class OC {
}
}
- OC::$WEBROOT = substr($scriptName, 0, strlen($scriptName) - strlen(OC::$SUBURI));
+ if (substr($scriptName, 0 - strlen(OC::$SUBURI)) === OC::$SUBURI) {
+ OC::$WEBROOT = substr($scriptName, 0, 0 - strlen(OC::$SUBURI));
- if (OC::$WEBROOT != '' and OC::$WEBROOT[0] !== '/') {
- OC::$WEBROOT = '/' . OC::$WEBROOT;
+ if (OC::$WEBROOT != '' && OC::$WEBROOT[0] !== '/') {
+ OC::$WEBROOT = '/' . OC::$WEBROOT;
+ }
+ } else {
+ // The scriptName is not ending with OC::$SUBURI
+ // This most likely means that we are calling from CLI.
+ // However some cron jobs still need to generate
+ // a web URL, so we use overwritewebroot as a fallback.
+ OC::$WEBROOT = OC_Config::getValue('overwritewebroot', '');
}
// search the 3rdparty folder
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list