Merge pull request #6390 from owncloud/migration-fixwebroot

Fix webroot for update page
This commit is contained in:
Vincent Petry 2013-12-13 05:35:29 -08:00
commit ad998c1fb5
2 changed files with 9 additions and 1 deletions

View File

@ -12,7 +12,14 @@ var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('dat
var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken');
if (typeof oc_webroot === "undefined") {
oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/'));
oc_webroot = location.pathname;
var pos = oc_webroot.indexOf('/index.php/');
if (pos !== -1) {
oc_webroot = oc_webroot.substr(0, pos);
}
else {
oc_webroot = oc_webroot.substr(0, oc_webroot.lastIndexOf('/'));
}
}
if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") {
if (!window.console) {

View File

@ -265,6 +265,7 @@ class OC {
$minimizerCSS->clearCache();
$minimizerJS = new OC_Minimizer_JS();
$minimizerJS->clearCache();
OC_Util::addScript('config'); // needed for web root
OC_Util::addScript('update');
$tmpl = new OC_Template('', 'update.admin', 'guest');
$tmpl->assign('version', OC_Util::getVersionString());