From: Tim Düsterhus Date: Fri, 27 May 2022 09:22:35 +0000 (+0200) Subject: Use `->prepare()` instead of `->prepareStatement()` in RoutingCacheBuilder X-Git-Tag: 6.0.0_Alpha_1~1258 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d0ad75d2b6b5dba31127fa27fa24fff7f2304c9;p=GitHub%2FWoltLab%2FWCF.git Use `->prepare()` instead of `->prepareStatement()` in RoutingCacheBuilder --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php index 3a6a4deeb9..019fe49e46 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -79,10 +79,15 @@ class RoutingCacheBuilder extends AbstractCacheBuilder $languageIDs[] = $language->languageID; } - $sql = "SELECT pageID, pageType, controller, controllerCustomURL, applicationPackageID, overrideApplicationPackageID - FROM wcf" . WCF_N . "_page + $sql = "SELECT pageID, + pageType, + controller, + controllerCustomURL, + applicationPackageID, + overrideApplicationPackageID + FROM wcf1_page WHERE overrideApplicationPackageID IS NOT NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $application = $abbreviations[$row['applicationPackageID']]; @@ -240,20 +245,25 @@ class RoutingCacheBuilder extends AbstractCacheBuilder } // fetch pages with a controller and a custom url - $sql = "SELECT controller, controllerCustomURL, applicationPackageID - FROM wcf" . WCF_N . "_page + $sql = "SELECT controller, + controllerCustomURL, + applicationPackageID + FROM wcf1_page WHERE controller <> '' AND controllerCustomURL <> ''"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $rows = $statement->fetchAll(\PDO::FETCH_ASSOC); // fetch content pages using the common page controller - $sql = "SELECT page_content.customURL AS controllerCustomURL, page_content.pageID, page_content.languageID, page.applicationPackageID - FROM wcf" . WCF_N . "_page_content page_content - LEFT JOIN wcf" . WCF_N . "_page page + $sql = "SELECT page_content.customURL AS controllerCustomURL, + page_content.pageID, + page_content.languageID, + page.applicationPackageID + FROM wcf1_page_content page_content + LEFT JOIN wcf1_page page ON page.pageID = page_content.pageID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $rows[] = $row;