From: Tim Düsterhus Date: Wed, 11 May 2022 12:19:25 +0000 (+0200) Subject: Remove `domainName` check in WCF::loadApplication() X-Git-Tag: 6.0.0_Alpha_1~1291^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=947cc78dd6bbdeb88726a390665f9dd06f517bd0;p=GitHub%2FWoltLab%2FWCF.git Remove `domainName` check in WCF::loadApplication() This was required for multi-domain setups. --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index f52b9dcc66..1db4ae6f20 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -680,19 +680,17 @@ class WCF // class was not found, possibly the app was moved, but `packageDir` has not been adjusted if (!\class_exists($className)) { - // check if both the Core and the app are on the same domain $coreApp = ApplicationHandler::getInstance()->getApplicationByID(1); - if ($coreApp->domainName === $application->domainName) { - // resolve the relative path and use it to construct the autoload directory - $relativePath = FileUtil::getRelativePath($coreApp->domainPath, $application->domainPath); - if ($relativePath !== './') { - $packageDir = FileUtil::getRealPath(WCF_DIR . $relativePath); - self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/'; - - if (\class_exists($className)) { - // the class can now be found, update the `packageDir` value - (new PackageEditor($package))->update(['packageDir' => $relativePath]); - } + + // resolve the relative path and use it to construct the autoload directory + $relativePath = FileUtil::getRelativePath($coreApp->domainPath, $application->domainPath); + if ($relativePath !== './') { + $packageDir = FileUtil::getRealPath(WCF_DIR . $relativePath); + self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/'; + + if (\class_exists($className)) { + // the class can now be found, update the `packageDir` value + (new PackageEditor($package))->update(['packageDir' => $relativePath]); } } }