From 91c8f7140c5a650a805d217193270e207f58fd91 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 4 Aug 2016 15:09:38 +0200 Subject: [PATCH] Fix calculation of document root in PackageInstallationDispatcher see 89ff24b4ac52c37ab3c4205277e335c061a6a887 --- .../package/PackageInstallationDispatcher.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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 -- 2.20.1