summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-07-25 19:39:29 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-07-25 19:39:29 +0200
commitec7a10f882ab64af0cee2379b64fde070dd060e4 (patch)
treeb647051c3b8d6f2bd1a04ce31e3b07c695bde5bb /lib/base.php
parent2594fb80aa7cff2de60c71f2daf9b42b5e2fed83 (diff)
downloadnextcloud-server-ec7a10f882ab64af0cee2379b64fde070dd060e4.tar.gz
nextcloud-server-ec7a10f882ab64af0cee2379b64fde070dd060e4.zip
reorder if statements to remove negation, indentation correction
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/base.php b/lib/base.php
index 939b23f87f9..d43ff0a9ce3 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -211,11 +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) {
- $url = 'http://' . $_SERVER['SERVER_NAME'] . OC::$WEBROOT . '/index.php';
- header("Location: $url");
+ if (OC::$CLI) {
+ throw new Exception('Not installed');
} else {
- throw new Exception("Not installed");
+ $url = 'http://' . $_SERVER['SERVER_NAME'] . OC::$WEBROOT . '/index.php';
+ header('Location: ' . $url);
}
exit();
}
@@ -522,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();
@@ -656,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(