From: Alexander Ebert Date: Sun, 2 Oct 2016 15:29:59 +0000 (+0200) Subject: Fixed two issues if installing in docroot on Windows X-Git-Tag: 3.0.0_Beta_2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d11a620647bd5cac9fc780cad0a1e1907ba8869;p=GitHub%2FWoltLab%2FWCF.git Fixed two issues if installing in docroot on Windows --- diff --git a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php index df03621198..70630e0a2a 100644 --- a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php +++ b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php @@ -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']) ]); diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index 6808d7bfd1..548f3a379f 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -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)) {