Fixed paths for apps in document root
authorAlexander Ebert <ebert@woltlab.com>
Thu, 6 Oct 2016 16:58:25 +0000 (18:58 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 6 Oct 2016 16:58:30 +0000 (18:58 +0200)
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 06c6fe3ee5b79479b15ccaa50c82c63db849f166..0e0a33f64c74f770e35204aa829d8678913997fd 100644 (file)
@@ -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);