From: Tim Düsterhus Date: Thu, 4 Aug 2016 13:09:38 +0000 (+0200) Subject: Fix calculation of document root in PackageInstallationDispatcher X-Git-Tag: 3.0.0_Beta_1~815 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91c8f7140c5a650a805d217193270e207f58fd91;p=GitHub%2FWoltLab%2FWCF.git Fix calculation of document root in PackageInstallationDispatcher see 89ff24b4ac52c37ab3c4205277e335c061a6a887 --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 8dfbbdb181..600573edb0 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -794,18 +794,7 @@ class PackageInstallationDispatcher { $wcfDomainPath = $row['domainPath']; } - $documentRoot = ''; - - // strip longest common suffix - $a = strrev(FileUtil::unifyDirSeparator($wcfDomainPath)); - $b = strrev($documentRoot = FileUtil::unifyDirSeparator(WCF_DIR)); - for ($i = 0, $max = min(strlen($a), strlen($b)); $i < $max; $i++) { - if ($a{$i} !== $b{$i}) { - $documentRoot = substr(strrev($b), 0, -$i); - break; - } - } - + $documentRoot = substr(FileUtil::unifyDirSeparator(WCF_DIR), 0, -strlen(FileUtil::unifyDirSeparator($wcfDomainPath))); $domainPath = FileUtil::addLeadingSlash(FileUtil::getRelativePath($documentRoot, $packageDir)); // update application path