From 1428f1ca6c9f8d9ab1b0d018842ac31b9620b94e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 2 Jul 2013 13:51:58 +0200 Subject: [PATCH] Fixed path calculation upon WCFSetup --- .../PackageInstallationDispatcher.class.php | 16 +++++++++++++++- 1 file changed, 15 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 2062908f6d..8c36137c71 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -650,7 +650,21 @@ class PackageInstallationDispatcher { // determine domain path, in some environments (e.g. ISPConfig) the $_SERVER paths are // faked and differ from the real filesystem path - $documentRoot = str_replace(ApplicationHandler::getInstance()->getWCF()->domainPath, '', FileUtil::unifyDirSeperator(WCF_DIR)); + if (PACKAGE_ID) { + $wcfDomainPath = ApplicationHandler::getInstance()->getWCF()->domainPath; + } + else { + $sql = "SELECT domainPath + FROM wcf".WCF_N."_application + WHERE packageID = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array(1)); + $row = $statement->fetchArray(); + + $wcfDomainPath = $row['domainPath']; + } + + $documentRoot = str_replace($wcfDomainPath, '', FileUtil::unifyDirSeperator(WCF_DIR)); $domainPath = str_replace($documentRoot, '', $packageDir); // update application path -- 2.20.1