diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-07-28 09:40:40 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-07-28 09:40:40 +0200 |
commit | 37f673c8b50f7768b204c642539ee880f6baa73d (patch) | |
tree | 18c9dea414d43341bacb3659859785b0926dfd0b /lib | |
parent | a1695722233199ac80580840ef7ee474f9a1bd33 (diff) | |
parent | ec7a10f882ab64af0cee2379b64fde070dd060e4 (diff) | |
download | nextcloud-server-37f673c8b50f7768b204c642539ee880f6baa73d.tar.gz nextcloud-server-37f673c8b50f7768b204c642539ee880f6baa73d.zip |
Merge pull request #9843 from owncloud/dont-silently-exit-in-cli-mode-master
don't silently exit in cli-mode in case ownCloud in not yet installed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/base.php b/lib/base.php index 730cee5231d..d43ff0a9ce3 100644 --- a/lib/base.php +++ b/lib/base.php @@ -211,9 +211,11 @@ class OC { public static function checkInstalled() { // Redirect to installer if not installed if (!OC_Config::getValue('installed', false) && OC::$SUBURI != '/index.php') { - if (!OC::$CLI) { + if (OC::$CLI) { + throw new Exception('Not installed'); + } else { $url = 'http://' . $_SERVER['SERVER_NAME'] . OC::$WEBROOT . '/index.php'; - header("Location: $url"); + header('Location: ' . $url); } exit(); } @@ -520,10 +522,10 @@ class OC { self::initTemplateEngine(); OC_App::loadApps(array('session')); - if (!self::$CLI) { - self::initSession(); - } else { + if (self::$CLI) { self::$session = new \OC\Session\Memory(''); + } else { + self::initSession(); } self::checkConfig(); self::checkInstalled(); @@ -654,8 +656,8 @@ class OC { if (!OC::$CLI // overwritehost is always trusted && OC_Request::getOverwriteHost() === null - && !OC_Request::isTrustedDomain($host)) { - + && !OC_Request::isTrustedDomain($host) + ) { header('HTTP/1.1 400 Bad Request'); header('Status: 400 Bad Request'); OC_Template::printErrorPage( |