Remove `domainName` check in WCF::loadApplication()
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:19:25 +0000 (14:19 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:24:41 +0000 (14:24 +0200)
This was required for multi-domain setups.

wcfsetup/install/files/lib/system/WCF.class.php

index f52b9dcc6601be32e2c1efffa10d82f26d1d3bcc..1db4ae6f2059754e927f73790cf1924a586628b5 100644 (file)
@@ -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]);
                 }
             }
         }