From: Matthias Schmidt Date: Thu, 4 Aug 2016 15:51:47 +0000 (+0200) Subject: Fix installation if document root is symlink X-Git-Tag: 3.0.0_Beta_1~808^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67f1b48496830bafddbc75e15def8a7e24ce2d88;p=GitHub%2FWoltLab%2FWCF.git Fix installation if document root is symlink --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index ad83714822..81699a8db9 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -456,15 +456,15 @@ class WCFSetup extends WCF { if ($application !== 'wcf') $showOrder[] = $application; } + $documentRoot = FileUtil::unifyDirSeparator(realpath($_SERVER['DOCUMENT_ROOT'])); if (self::$developerMode && isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) { // resolve path relative to document root - $relativePath = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], INSTALL_SCRIPT_DIR); + $relativePath = FileUtil::getRelativePath($documentRoot, INSTALL_SCRIPT_DIR); foreach ($packages as $application => $packageData) { self::$directories[$application] = $relativePath . ($application === 'wcf' ? '' : $packageData['directory'] . '/'); } } - $documentRoot = FileUtil::unifyDirSeparator($_SERVER['DOCUMENT_ROOT']); $errors = []; if (!empty(self::$directories)) { $applicationPaths = $knownPaths = []; @@ -515,7 +515,7 @@ class WCFSetup extends WCF { } else { // resolve path relative to document root - $relativePath = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], INSTALL_SCRIPT_DIR); + $relativePath = FileUtil::getRelativePath($documentRoot, INSTALL_SCRIPT_DIR); foreach ($packages as $application => $packageData) { self::$directories[$application] = $relativePath . ($application === 'wcf' ? '' : $packageData['directory'] . '/'); }