Support `Database::prepare()` during WCFSetup
authorMatthias Schmidt <gravatronics@live.com>
Fri, 11 Jun 2021 15:11:48 +0000 (17:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 11 Jun 2021 15:11:48 +0000 (17:11 +0200)
wcfsetup/install/files/lib/system/database/Database.class.php

index 2633d043bcafe129835efb089d23387e0c823c98..810394e8f862ba1338b80b0584b61d9c5dff513e 100644 (file)
@@ -346,12 +346,16 @@ abstract class Database
     {
         static $regex = null;
         if ($regex === null) {
-            $abbreviations = \implode(
-                '|',
-                \array_map(static function (Application $app): string {
-                    return \preg_quote($app->getAbbreviation(), '~');
-                }, ApplicationHandler::getInstance()->getApplications())
-            );
+            if (!PACKAGE_ID) {
+                $abbreviations = 'wcf';
+            } else {
+                $abbreviations = \implode(
+                    '|',
+                    \array_map(static function (Application $app): string {
+                        return \preg_quote($app->getAbbreviation(), '~');
+                    }, ApplicationHandler::getInstance()->getApplications())
+                );
+            }
 
             $regex = "~(\\b(?:{$abbreviations}))1_~";
         }