Disables rescue mode for cli
authorMatthias Schmidt <gravatronics@live.com>
Tue, 26 Nov 2013 17:31:14 +0000 (18:31 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 26 Nov 2013 17:31:14 +0000 (18:31 +0100)
wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index 08341e10d6d448a9b1dfb3a391aed4e6a4d6f51d..898cbd651eb245494322c45025ee0c6b908eb89c 100644 (file)
@@ -43,19 +43,25 @@ class RequestHandler extends SingletonFactory {
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
-                       if ($application->domainName == $_SERVER['HTTP_HOST']) {
-                               $this->inRescueMode = false;
-                               break;
+               if (isset($_SERVER['HTTP_HOST'])) {
+                       foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
+                               if ($application->domainName == $_SERVER['HTTP_HOST']) {
+                                       $this->inRescueMode = false;
+                                       break;
+                               }
                        }
-               }
-               
-               // check if WCF is running as standalone
-               if ($this->inRescueMode() && PACKAGE_ID == 1) {
-                       if (ApplicationHandler::getInstance()->getWCF()->domainName == $_SERVER['HTTP_HOST']) {
-                               $this->inRescueMode = false;
+                       
+                       // check if WCF is running as standalone
+                       if ($this->inRescueMode() && PACKAGE_ID == 1) {
+                               if (ApplicationHandler::getInstance()->getWCF()->domainName == $_SERVER['HTTP_HOST']) {
+                                       $this->inRescueMode = false;
+                               }
                        }
                }
+               else {
+                       // when using cli, no rescue mode is provided
+                       $this->inRescueMode = false;
+               }
        }
        
        /**