From 67f1b48496830bafddbc75e15def8a7e24ce2d88 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 4 Aug 2016 17:51:47 +0200 Subject: [PATCH] Fix installation if document root is symlink --- wcfsetup/install/files/lib/system/WCFSetup.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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'] . '/'); } -- 2.20.1