From e268ef2ea6827d2b12542c2f3700ab66a5dd751e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 6 Oct 2016 18:58:25 +0200 Subject: [PATCH] Fixed paths for apps in document root --- .../package/PackageInstallationDispatcher.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.20.1