Fixed two issues if installing in docroot on Windows
authorAlexander Ebert <ebert@woltlab.com>
Sun, 2 Oct 2016 15:29:59 +0000 (17:29 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 2 Oct 2016 15:30:07 +0000 (17:30 +0200)
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php

index df036211983985eaf015581d9bfd7cbbc3c395c8..70630e0a2a8b188eb961ca5f410cc3c52875b3a6 100644 (file)
@@ -95,7 +95,7 @@ class ApplicationHandler extends SingletonFactory {
                        
                        return new Application(null, [
                                'domainName' => $host,
-                               'domainPath' => RouteHandler::getPath(),
+                               'domainPath' => RouteHandler::getPath(['acp']),
                                'cookieDomain' => $host,
                                'cookiePath' => RouteHandler::getPath(['acp'])
                        ]);
index 6808d7bfd1ef4c206697d9a8f5d8696f5250de43..548f3a379ff921712b38462f9133f28364e9242a 100644 (file)
@@ -264,7 +264,9 @@ class RouteHandler extends SingletonFactory {
         */
        public static function getPath(array $removeComponents = []) {
                if (empty(self::$path)) {
-                       self::$path = FileUtil::addTrailingSlash(dirname($_SERVER['SCRIPT_NAME']));
+                       // dirname return a single backslash on Windows if there are no parent directories 
+                       $dir = dirname($_SERVER['SCRIPT_NAME']);
+                       self::$path = ($dir === '\\') ? '/' : FileUtil::addTrailingSlash($dir);
                }
                
                if (!empty($removeComponents)) {