From: Alexander Ebert Date: Thu, 6 Oct 2016 16:58:25 +0000 (+0200) Subject: Fixed paths for apps in document root X-Git-Tag: 3.0.0_Beta_3~50^2~69 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e268ef2ea6827d2b12542c2f3700ab66a5dd751e;p=GitHub%2FWoltLab%2FWCF.git Fixed paths for apps in document root --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 06c6fe3ee5..0e0a33f64c 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -793,7 +793,13 @@ class PackageInstallationDispatcher { } $documentRoot = substr(FileUtil::unifyDirSeparator(WCF_DIR), 0, -strlen(FileUtil::unifyDirSeparator($wcfDomainPath))); - $domainPath = FileUtil::addLeadingSlash(FileUtil::getRelativePath($documentRoot, $packageDir)); + $domainPath = FileUtil::getRelativePath($documentRoot, $packageDir); + if ($domainPath === './') { + // `FileUtil::getRelativePath()` returns `./` if both paths lead to the same directory + $domainPath = '/'; + } + + $domainPath = FileUtil::addLeadingSlash($domainPath); // update application path $application = new Application($this->getPackage()->packageID);