From c240c98adab0f1d7981e79e36e63cdbbab932f55 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 4 Feb 2021 17:15:11 +0100 Subject: [PATCH] Remove unnecessary parentheses around join conditions --- .../action/UserQuickSearchAction.class.php | 12 +++++----- .../lib/acp/form/UserSearchForm.class.php | 2 +- .../lib/acp/page/CronjobLogListPage.class.php | 2 +- .../lib/acp/page/LabelListPage.class.php | 2 +- ...bscriptionTransactionLogListPage.class.php | 4 ++-- .../PaidSubscriptionUserListPage.class.php | 4 ++-- .../files/lib/acp/page/UserListPage.class.php | 6 ++--- .../lib/acp/page/UserRankListPage.class.php | 2 +- .../lib/data/I18nDatabaseObjectList.class.php | 6 ++--- .../acp/session/log/ACPSessionLog.class.php | 2 +- .../session/log/ACPSessionLogList.class.php | 4 ++-- .../data/article/ViewableArticle.class.php | 24 +++++++------------ .../article/ViewableArticleList.class.php | 4 ++-- .../AdministrativeAttachmentList.class.php | 2 +- .../LikeableCommentResponseProvider.class.php | 2 +- ...evtoolsMissingLanguageItemAction.class.php | 6 ++--- .../data/language/LanguageEditor.class.php | 2 +- .../files/lib/data/media/MediaList.class.php | 2 +- .../data/media/ViewableMediaList.class.php | 2 +- .../queue/ModerationQueueAction.class.php | 10 ++++---- .../ViewableModerationQueueList.class.php | 4 ++-- .../update/PackageUpdateAction.class.php | 4 ++-- .../files/lib/data/style/Style.class.php | 3 ++- .../lib/data/style/StyleEditor.class.php | 12 ++++------ .../lib/data/template/Template.class.php | 4 ++-- .../lib/data/template/TemplateList.class.php | 4 ++-- .../files/lib/data/user/TeamList.class.php | 4 ++-- .../files/lib/data/user/User.class.php | 8 +++---- .../files/lib/data/user/UserAction.class.php | 2 +- .../files/lib/data/user/UserList.class.php | 2 +- .../lib/data/user/UserProfileAction.class.php | 2 +- .../lib/data/user/UserProfileList.class.php | 6 ++--- .../user/follow/UserFollowerList.class.php | 4 ++-- .../user/follow/UserFollowingList.class.php | 8 +++---- .../lib/data/user/group/UserGroup.class.php | 2 +- .../ignore/ViewableUserIgnoreList.class.php | 8 +++---- ...erNotificationEventRecipientList.class.php | 2 +- .../user/online/UsersOnlineList.class.php | 12 +++++----- .../visitor/UserProfileVisitorList.class.php | 4 ++-- .../files/lib/form/UserSearchForm.class.php | 2 +- .../page/CategoryArticleListPage.class.php | 10 ++++---- .../lib/page/UnreadArticleListPage.class.php | 2 +- ...cationEmailDeliveryBackgroundJob.class.php | 4 ++-- .../ArticleCommentListBoxController.class.php | 4 ++-- .../files/lib/system/box/BoxHandler.class.php | 2 +- .../ProfileCommentListBoxController.class.php | 2 +- .../builder/BBCodeCacheBuilder.class.php | 2 +- .../builder/CategoryCacheBuilder.class.php | 2 +- .../builder/RoutingCacheBuilder.class.php | 2 +- .../UserGroupPermissionCacheBuilder.class.php | 2 +- ...serNotificationEventCacheBuilder.class.php | 2 +- .../system/comment/CommentHandler.class.php | 20 +++++++--------- .../DailyMailNotificationCronjob.class.php | 4 ++-- ...iringPaidSubscriptionUserCronjob.class.php | 2 +- .../system/importer/ImportHandler.class.php | 2 +- .../lib/system/like/LikeHandler.class.php | 8 +++---- ...ntResponseModerationQueueHandler.class.php | 2 +- .../queue/ModerationQueueManager.class.php | 16 ++++++------- .../system/package/PackageArchive.class.php | 4 ++-- .../PackageInstallationScheduler.class.php | 10 ++++---- .../package/PackageUpdateDispatcher.class.php | 9 +++---- .../BoxPackageInstallationPlugin.class.php | 2 +- ...anguagePackageInstallationPlugin.class.php | 2 +- ...emplatePackageInstallationPlugin.class.php | 2 +- .../PackageValidationArchive.class.php | 2 +- ...coratedCategoryLookupPageHandler.class.php | 2 +- .../page/handler/TrophyPageHandler.class.php | 2 +- .../lib/system/poll/PollManager.class.php | 2 +- .../system/reaction/ReactionHandler.class.php | 16 +++++-------- .../lib/system/search/ArticleSearch.class.php | 2 +- .../lib/system/search/PageSearch.class.php | 2 +- .../search/mysql/MysqlSearchEngine.class.php | 2 +- .../MultilingualPageSitemapObject.class.php | 4 ++-- .../AbstractCommentStatDailyHandler.class.php | 4 ++-- .../lib/system/tagging/TagEngine.class.php | 2 +- .../TrophyConditionHandler.class.php | 4 ++-- .../UserNotificationHandler.class.php | 4 ++-- ...ommentUserNotificationObjectType.class.php | 2 +- ...ommentUserNotificationObjectType.class.php | 2 +- .../lib/system/worker/MailWorker.class.php | 2 +- ...ivityPointItemsRebuildDataWorker.class.php | 2 +- .../worker/UserRebuildDataWorker.class.php | 6 ++--- .../files/lib/util/MessageUtil.class.php | 2 +- 83 files changed, 176 insertions(+), 202 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php index 1a5a974c07..58a0beedc5 100644 --- a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php @@ -100,7 +100,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID WHERE banned = ?"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); $statement->execute([1]); @@ -114,7 +114,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID ORDER BY user_table.registrationDate DESC"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); $statement->execute(); @@ -127,7 +127,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID WHERE activationCode <> ? ORDER BY user_table.registrationDate DESC"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); @@ -147,7 +147,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID " . $conditionBuilder . " ORDER BY user_table.registrationDate DESC"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); @@ -159,7 +159,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID WHERE disableAvatar = ?"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); $statement->execute([1]); @@ -170,7 +170,7 @@ class UserQuickSearchAction extends AbstractAction $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID WHERE disableSignature = ?"; $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); $statement->execute([1]); diff --git a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php index 25a9d08dc9..e04bb9017b 100755 --- a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php @@ -270,7 +270,7 @@ class UserSearchForm extends UserOptionListForm protected function search() { $this->userList = new UserList(); - $this->userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; + $this->userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; $this->userList->sqlLimit = $this->maxResults; EventHandler::getInstance()->fireAction($this, 'search'); diff --git a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php index 91c58797fe..68f2edd2d2 100755 --- a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php @@ -93,7 +93,7 @@ class CronjobLogListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = "cronjob.*"; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_cronjob cronjob ON (cronjob.cronjobID = cronjob_log.cronjobID)"; + $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_cronjob cronjob ON cronjob.cronjobID = cronjob_log.cronjobID"; if ($this->cronjobID) { $this->objectList->getConditionBuilder()->add('cronjob_log.cronjobID = ?', [$this->cronjobID]); diff --git a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php index 103840ae53..a50f0af191 100644 --- a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php @@ -110,7 +110,7 @@ class LabelListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = "label_group.groupName, label_group.groupDescription"; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_label_group label_group ON (label_group.groupID = label.groupID)"; + $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_label_group label_group ON label_group.groupID = label.groupID"; if ($this->labelGroup) { $this->objectList->getConditionBuilder()->add('label.groupID = ?', [$this->labelGroup->groupID]); diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php index f21a2873b0..8c330b2b22 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php @@ -127,8 +127,8 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage } $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = paid_subscription_transaction_log.userID)"; - $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID)"; + $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_transaction_log.userID"; + $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID"; } /** diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php index 5a57166617..8e3083ae96 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php @@ -99,8 +99,8 @@ class PaidSubscriptionUserListPage extends SortablePage $this->objectList->getConditionBuilder()->add('paid_subscription_user.isActive = ?', [1]); $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = paid_subscription_user.userID)"; - $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_user.subscriptionID)"; + $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_user.userID"; + $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; } /** diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index cd83e43e86..d625a148c4 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -260,7 +260,7 @@ class UserListPage extends SortablePage // get user ids $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table - " . (isset($this->options[$this->sortField]) ? "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)" : '') . " + " . (isset($this->options[$this->sortField]) ? "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID" : '') . " " . $this->conditions . " ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption' . $this->options[$this->sortField]->optionID : $this->sortField) . " " . $this->sortOrder; $statement = WCF::getDB()->prepareStatement( @@ -287,9 +287,9 @@ class UserListPage extends SortablePage $sql = "SELECT user_avatar.*, option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID) + ON option_value.userID = user_table.userID LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar - ON (user_avatar.avatarID = user_table.avatarID) + ON user_avatar.avatarID = user_table.avatarID " . $conditions . " ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption' . $this->options[$this->sortField]->optionID : 'user_table.' . $this->sortField) . " " . $this->sortOrder; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php index 2efcff1712..a6476722cc 100644 --- a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php @@ -55,6 +55,6 @@ class UserRankListPage extends SortablePage parent::initObjectList(); $this->objectList->sqlSelects = 'user_group.groupName'; - $this->objectList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_user_group user_group ON (user_group.groupID = user_rank.groupID)'; + $this->objectList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_user_group user_group ON user_group.groupID = user_rank.groupID'; } } diff --git a/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php index 07a9f8f599..4ae5d98aeb 100644 --- a/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php @@ -57,10 +57,8 @@ abstract class I18nDatabaseObjectList extends DatabaseObjectList $this->sqlSelects .= (!empty($this->sqlSelects) ? ', ' : '') . "COALESCE(" . $matchTable . ".languageItemValue, " . $this->getDatabaseTableAlias() . "." . $key . ") AS " . $value; $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_language_item " . $matchTable . " - ON ( - " . $matchTable . ".languageItem = " . $this->getDatabaseTableAlias() . "." . $key . " - AND " . $matchTable . ".languageID = " . $languageID . " - )"; + ON " . $matchTable . ".languageItem = " . $this->getDatabaseTableAlias() . "." . $key . " + AND " . $matchTable . ".languageID = " . $languageID; } } } diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php index 51ce65af82..3555dfc415 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php @@ -42,7 +42,7 @@ class ACPSessionLog extends DatabaseObject $sql = "SELECT acp_session_log.*, user_table.username, 0 AS active FROM wcf" . WCF_N . "_acp_session_log acp_session_log LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = acp_session_log.userID) + ON user_table.userID = acp_session_log.userID WHERE acp_session_log.sessionLogID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$id]); diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php index c7807ccdd8..02a0d35f1b 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php @@ -42,8 +42,8 @@ class ACPSessionLogList extends DatabaseObjectList ) AS accesses"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = " . $this->getDatabaseTableAlias() . ".userID)"; + LEFT JOIN wcf" . WCF_N . "_user user_table + ON user_table.userID = " . $this->getDatabaseTableAlias() . ".userID"; parent::readObjects(); } diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php index 545b71bcf9..9004c2d2c2 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php @@ -256,11 +256,9 @@ class ViewableArticle extends DatabaseObjectDecorator $sql = "SELECT COUNT(*) FROM wcf" . WCF_N . "_article article LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit - ON ( - tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " - AND tracked_visit.objectID = article.articleID - AND tracked_visit.userID = " . WCF::getUser()->userID . " - ) + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " + AND tracked_visit.objectID = article.articleID + AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); @@ -384,11 +382,9 @@ class ViewableArticle extends DatabaseObjectDecorator $sql = "SELECT COUNT(*) FROM wcf" . WCF_N . "_article article LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit - ON ( - tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " - AND tracked_visit.objectID = article.articleID - AND tracked_visit.userID = " . WCF::getUser()->userID . " - ) + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " + AND tracked_visit.objectID = article.articleID + AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); @@ -427,11 +423,9 @@ class ViewableArticle extends DatabaseObjectDecorator $sql = "SELECT COUNT(*) FROM wcf" . WCF_N . "_article article LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit - ON ( - tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " - AND tracked_visit.objectID = article.articleID - AND tracked_visit.userID = " . WCF::getUser()->userID . " - ) + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " + AND tracked_visit.objectID = article.articleID + AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php index e0d6453cc3..58daaabc45 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php @@ -49,14 +49,14 @@ class ViewableArticleList extends ArticleList $this->sqlSelects .= ','; } $this->sqlSelects .= 'tracked_visit.visitTime'; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON (tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . ")"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; } if (!empty($this->sqlSelects)) { $this->sqlSelects .= ','; } $this->sqlSelects .= "like_object.cachedReactions"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_like_object like_object ON (like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_like_object like_object ON like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID"; } /** diff --git a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php index e072ac0952..345ddd9540 100644 --- a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php @@ -33,7 +33,7 @@ class AdministrativeAttachmentList extends AttachmentList parent::__construct(); $this->sqlSelects = 'user_table.username'; - $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = attachment.userID)"; + $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = attachment.userID"; } /** diff --git a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php index d126e7b8d9..ec434bdd1f 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php @@ -77,7 +77,7 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme $sql = "SELECT comment.objectTypeID, comment_response.responseID FROM wcf" . WCF_N . "_comment_response comment_response LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID) + ON comment.commentID = comment_response.commentID " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/files/lib/data/devtools/missing/language/item/DevtoolsMissingLanguageItemAction.class.php b/wcfsetup/install/files/lib/data/devtools/missing/language/item/DevtoolsMissingLanguageItemAction.class.php index cfae0270a6..1fe037bb3e 100644 --- a/wcfsetup/install/files/lib/data/devtools/missing/language/item/DevtoolsMissingLanguageItemAction.class.php +++ b/wcfsetup/install/files/lib/data/devtools/missing/language/item/DevtoolsMissingLanguageItemAction.class.php @@ -114,10 +114,8 @@ class DevtoolsMissingLanguageItemAction extends AbstractDatabaseObjectAction imp $sql = "DELETE devtools_missing_language_item FROM wcf" . WCF_N . "_devtools_missing_language_item devtools_missing_language_item INNER JOIN wcf" . WCF_N . "_language_item language_item - ON ( - language_item.languageItem = devtools_missing_language_item.languageItem - AND language_item.languageID = devtools_missing_language_item.languageID - )"; + ON language_item.languageItem = devtools_missing_language_item.languageItem + AND language_item.languageID = devtools_missing_language_item.languageID"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); } diff --git a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php index 4709925abd..e00236cfcd 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php @@ -156,7 +156,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje languageCategory FROM wcf" . WCF_N . "_language_item language_item LEFT JOIN wcf" . WCF_N . "_language_category language_category - ON (language_category.languageCategoryID = language_item.languageCategoryID) + ON language_category.languageCategoryID = language_item.languageCategoryID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/data/media/MediaList.class.php b/wcfsetup/install/files/lib/data/media/MediaList.class.php index 14f821f1e6..e193ee7e80 100644 --- a/wcfsetup/install/files/lib/data/media/MediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaList.class.php @@ -39,7 +39,7 @@ class MediaList extends DatabaseObjectList $searchString = '%' . \addcslashes($searchString, '_%') . '%'; - $this->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_media_content media_content ON (media_content.mediaID = media.mediaID)'; + $this->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_media_content media_content ON media_content.mediaID = media.mediaID'; $conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR'); $conditionBuilder->add('media_content.title LIKE ?', [$searchString]); diff --git a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php index 2c969395e5..aff03d87ee 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php @@ -40,6 +40,6 @@ class ViewableMediaList extends MediaList // fetch content data $this->sqlSelects .= "media_content.*, COALESCE(media.languageID, " . $languageID . ") AS localizedLanguageID"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_media_content media_content ON (media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . "))"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_media_content media_content ON media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")"; } } diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 7b61bee64c..2c463f5613 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -130,13 +130,11 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction $sql = "SELECT moderation_queue.queueID FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue - ON (moderation_queue.queueID = moderation_queue_to_user.queueID) + ON moderation_queue.queueID = moderation_queue_to_user.queueID LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit - ON ( - tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " - AND tracked_visit.objectID = moderation_queue.queueID - AND tracked_visit.userID = " . WCF::getUser()->userID . " - ) + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " + AND tracked_visit.objectID = moderation_queue.queueID + AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditions . " ORDER BY moderation_queue.lastChangeTime DESC"; $statement = WCF::getDB()->prepareStatement($sql, $MAX_ITEMS); diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php index 2d1a94fdde..03d85e0a39 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php @@ -45,8 +45,8 @@ class ViewableModerationQueueList extends ModerationQueueList $this->sqlSelects = "moderation_queue.*, assigned_user.username AS assignedUsername, user_table.username"; $this->sqlConditionJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; $this->sqlJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user assigned_user ON (assigned_user.userID = moderation_queue.assignedUserID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = moderation_queue.userID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user assigned_user ON assigned_user.userID = moderation_queue.assignedUserID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = moderation_queue.userID"; $this->getConditionBuilder()->add("moderation_queue_to_user.queueID = moderation_queue.queueID"); $this->getConditionBuilder()->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]); $this->getConditionBuilder()->add("moderation_queue_to_user.isAffected = ?", [1]); diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index ad814d5561..11a9357618 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -97,7 +97,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $sql = "SELECT package_update.packageUpdateID FROM wcf" . WCF_N . "_package_update package_update LEFT JOIN wcf" . WCF_N . "_package package - ON (package.package = package_update.package) + ON package.package = package_update.package " . $conditions . " ORDER BY package_update.packageName ASC"; $statement = WCF::getDB()->prepareStatement($sql, 1000); @@ -319,7 +319,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $sql = "SELECT pu.package, puv.packageUpdateVersionID, puv.packageUpdateID, puv.packageVersion, puv.isAccessible FROM wcf" . WCF_N . "_package_update_version puv LEFT JOIN wcf" . WCF_N . "_package_update pu - ON (pu.packageUpdateID = puv.packageUpdateID) + ON pu.packageUpdateID = puv.packageUpdateID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index 41c6a549e1..01b2353c5b 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -162,7 +162,8 @@ class Style extends DatabaseObject $sql = "SELECT variable.variableName, variable.defaultValue, value.variableValue FROM wcf" . WCF_N . "_style_variable variable LEFT JOIN wcf" . WCF_N . "_style_variable_value value - ON (value.variableID = variable.variableID AND value.styleID = ?) + ON value.variableID = variable.variableID + AND value.styleID = ? ORDER BY variable.variableID ASC"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->styleID]); diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 42a52d982d..2b7b84c0fb 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -155,10 +155,8 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $sql = "SELECT variable.variableName FROM wcf" . WCF_N . "_style_variable variable LEFT JOIN wcf" . WCF_N . "_style_variable_value variable_value - ON ( - variable_value.variableID = variable.variableID - AND variable_value.styleID = ? - ) + ON variable_value.variableID = variable.variableID + AND variable_value.styleID = ? WHERE variable.variableName LIKE ? AND variable_value.variableValue IS NULL"; $statement = WCF::getDB()->prepareStatement($sql); @@ -861,7 +859,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $sql = "SELECT language.languageCode, language_item.languageItemValue FROM wcf" . WCF_N . "_language_item language_item LEFT JOIN wcf" . WCF_N . "_language language - ON (language.languageID = language_item.languageID) + ON language.languageID = language_item.languageID WHERE language_item.languageItem = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->styleDescription]); @@ -938,7 +936,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $sql = "SELECT variable.variableName, value.variableValue FROM wcf" . WCF_N . "_style_variable_value value LEFT JOIN wcf" . WCF_N . "_style_variable variable - ON (variable.variableID = value.variableID) + ON variable.variableID = value.variableID WHERE value.styleID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->styleID]); @@ -962,7 +960,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $sql = "SELECT template.*, package.package FROM wcf" . WCF_N . "_template template LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = template.packageID) + ON package.packageID = template.packageID WHERE template.templateGroupID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->templateGroupID]); diff --git a/wcfsetup/install/files/lib/data/template/Template.class.php b/wcfsetup/install/files/lib/data/template/Template.class.php index 0f045cbae8..eeb269eb15 100644 --- a/wcfsetup/install/files/lib/data/template/Template.class.php +++ b/wcfsetup/install/files/lib/data/template/Template.class.php @@ -43,9 +43,9 @@ class Template extends DatabaseObject package.package FROM wcf" . WCF_N . "_template template LEFT JOIN wcf" . WCF_N . "_template_group template_group - ON (template_group.templateGroupID = template.templateGroupID) + ON template_group.templateGroupID = template.templateGroupID LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = template.packageID) + ON package.packageID = template.packageID WHERE template.templateID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$id]); diff --git a/wcfsetup/install/files/lib/data/template/TemplateList.class.php b/wcfsetup/install/files/lib/data/template/TemplateList.class.php index 5fa4e4155f..ddbc984443 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateList.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateList.class.php @@ -34,8 +34,8 @@ class TemplateList extends DatabaseObjectList parent::__construct(); $this->sqlSelects = 'package.package, template_group.templateGroupFolderName'; - $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_package package ON (package.packageID = template.packageID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_template_group template_group ON (template_group.templateGroupID = template.templateGroupID)"; + $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_package package ON package.packageID = template.packageID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_template_group template_group ON template_group.templateGroupID = template.templateGroupID"; } /** diff --git a/wcfsetup/install/files/lib/data/user/TeamList.class.php b/wcfsetup/install/files/lib/data/user/TeamList.class.php index 0aed5f70ff..824ee5517f 100644 --- a/wcfsetup/install/files/lib/data/user/TeamList.class.php +++ b/wcfsetup/install/files/lib/data/user/TeamList.class.php @@ -48,7 +48,7 @@ class TeamList extends UserProfileList FROM wcf" . WCF_N . "_user_group user_group, wcf" . WCF_N . "_user_to_group user_to_group LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = user_to_group.userID) + ON user_table.userID = user_to_group.userID WHERE user_to_group.groupID = user_group.groupID AND user_group.showOnTeamPage = 1 ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : ''); @@ -68,7 +68,7 @@ class TeamList extends UserProfileList FROM wcf" . WCF_N . "_user_group user_group, wcf" . WCF_N . "_user_to_group user_to_group LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = user_to_group.userID) + ON user_table.userID = user_to_group.userID WHERE user_to_group.groupID = user_group.groupID AND user_group.showOnTeamPage = 1 ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : ''); diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index 157c630155..5e4018fc52 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -129,7 +129,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl $sql = "SELECT user_option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = user_table.userID) + ON user_option_value.userID = user_table.userID WHERE user_table.userID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$id]); @@ -354,7 +354,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl $sql = "SELECT user_option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = user_table.userID) + ON user_option_value.userID = user_table.userID WHERE user_table.username = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$username]); @@ -377,7 +377,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl $sql = "SELECT user_option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = user_table.userID) + ON user_option_value.userID = user_table.userID WHERE user_table.email = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$email]); @@ -400,7 +400,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl $sql = "SELECT user_option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = user_table.userID) + ON user_option_value.userID = user_table.userID WHERE user_table.authData = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$authData]); diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index e439069fff..89fd1f4208 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -831,7 +831,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio $sql = "SELECT user_option_value.*, user_table.* FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = user_table.userID) + ON user_option_value.userID = user_table.userID WHERE user_table.userID IN (" . \str_repeat('?,', \count($this->objectIDs) - 1) . "?)"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($this->objectIDs); diff --git a/wcfsetup/install/files/lib/data/user/UserList.class.php b/wcfsetup/install/files/lib/data/user/UserList.class.php index 0ac3c6e90b..c4592a2286 100644 --- a/wcfsetup/install/files/lib/data/user/UserList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserList.class.php @@ -35,6 +35,6 @@ class UserList extends DatabaseObjectList $this->sqlSelects .= ','; } $this->sqlSelects .= "user_option_value.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; } } diff --git a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php index 4579373c46..92f06e2124 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php @@ -395,7 +395,7 @@ class UserProfileAction extends UserAction implements IPopoverAction $sql = "SELECT user_rank.rankID FROM wcf" . WCF_N . "_user_rank user_rank LEFT JOIN wcf" . WCF_N . "_user_group user_group - ON (user_group.groupID = user_rank.groupID) + ON user_group.groupID = user_rank.groupID " . $conditionBuilder . " ORDER BY user_group.priority DESC, user_rank.requiredPoints DESC, user_rank.requiredGender DESC"; $statement = WCF::getDB()->prepareStatement($sql, 1); diff --git a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php index 3c7d54f855..142b9af914 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php @@ -38,16 +38,16 @@ class UserProfileList extends UserList $this->sqlSelects .= ','; } $this->sqlSelects .= "user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; } // get current location $this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_session session ON (session.userID = user_table.userID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_session session ON session.userID = user_table.userID"; } /** diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php index c2ee85d8be..cee6bf39ea 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php @@ -50,7 +50,7 @@ class UserFollowerList extends UserFollowList $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_follow.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php index 25ad4f1a02..fcd10a67e9 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php @@ -28,13 +28,13 @@ class UserFollowingList extends UserFollowerList $this->sqlSelects .= "user_avatar.*, user_follow.followID, user_option_value.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_follow.followUserID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.followUserID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; } $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index d130003eeb..d0045c2693 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -504,7 +504,7 @@ class UserGroup extends DatabaseObject implements ITitledObject $sql = "SELECT group_option.optionName, option_value.optionValue FROM wcf" . WCF_N . "_user_group_option_value option_value LEFT JOIN wcf" . WCF_N . "_user_group_option group_option - ON (group_option.optionID = option_value.optionID) + ON group_option.optionID = option_value.optionID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php index 6392da7ba3..c69608aae7 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php @@ -49,13 +49,13 @@ class ViewableUserIgnoreList extends UserIgnoreList $this->sqlSelects .= ", user_option_value.*"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_ignore.ignoreUserID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_ignore.ignoreUserID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; if (MODULE_USER_RANK) { $this->sqlSelects .= ",user_rank.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID"; } $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php index c151fc8c36..0dc913aa71 100644 --- a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php @@ -19,7 +19,7 @@ class UserNotificationEventRecipientList extends UserList */ public function __construct() { - $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = event_to_user.userID)"; + $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = event_to_user.userID"; $this->sqlSelects = 'user_table.*'; parent::__construct(); diff --git a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php index 8008ff193c..f825830d41 100644 --- a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php +++ b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php @@ -57,11 +57,11 @@ class UsersOnlineList extends SessionList $this->sqlSelects .= "user_avatar.*, user_option_value.*, user_group.userOnlineMarking, user_table.*"; - $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = session.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = session.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_group user_group ON (user_group.groupID = user_table.userOnlineGroupID)"; + $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_group user_group ON user_group.groupID = user_table.userOnlineGroupID"; $this->getConditionBuilder()->add('session.lastActivityTime > ?', [TIME_NOW - USER_ONLINE_TIMEOUT]); } @@ -98,7 +98,7 @@ class UsersOnlineList extends SessionList $sql = "SELECT user_option_value.userOption" . User::getUserOptionID('canViewOnlineStatus') . " AS canViewOnlineStatus, session.userID FROM wcf" . WCF_N . "_session session LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value - ON (user_option_value.userID = session.userID) + ON user_option_value.userID = session.userID " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php index 3643a7f2ed..603ff3779d 100644 --- a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php @@ -46,7 +46,7 @@ class UserProfileVisitorList extends DatabaseObjectList $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension"; $this->sqlSelects .= ", user_avatar.*"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_profile_visitor.userID)"; - $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_profile_visitor.userID"; + $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/form/UserSearchForm.class.php index 23ed2ecd62..b95c8a6f2c 100644 --- a/wcfsetup/install/files/lib/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/form/UserSearchForm.class.php @@ -174,7 +174,7 @@ class UserSearchForm extends UserOptionListForm $sql = "SELECT user_table.userID FROM wcf" . WCF_N . "_user user_table LEFT JOIN wcf" . WCF_N . "_user_option_value option_value - ON (option_value.userID = user_table.userID)"; + ON option_value.userID = user_table.userID"; // build search condition $this->conditions = new PreparedStatementConditionBuilder(); diff --git a/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php b/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php index a14fd3bb55..9bab3f74e8 100644 --- a/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php @@ -97,12 +97,10 @@ class CategoryArticleListPage extends ArticleListPage if ($this->category->sortField === 'title') { $this->objectList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_article_content article_content - ON ( - article_content.articleID = article.articleID - AND ( - article_content.languageID IS NULL - OR article_content.languageID = ' . WCF::getLanguage()->languageID . ' - ) + ON article_content.articleID = article.articleID + AND ( + article_content.languageID IS NULL + OR article_content.languageID = ' . WCF::getLanguage()->languageID . ' )'; } diff --git a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php index d0a9b19544..bf9acf27f1 100644 --- a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php @@ -59,7 +59,7 @@ class UnreadArticleListPage extends ArticleListPage ); if (WCF::getUser()->userID) { - $this->objectList->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON (tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . ")"; + $this->objectList->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; $this->objectList->getConditionBuilder()->add("(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)"); } } diff --git a/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php b/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php index 353bd3f328..e9d05ca01b 100644 --- a/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php +++ b/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php @@ -79,9 +79,9 @@ class NotificationEmailDeliveryBackgroundJob extends AbstractBackgroundJob $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType FROM wcf" . WCF_N . "_user_notification notification LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event - ON (notification_event.eventID = notification.eventID) + ON notification_event.eventID = notification.eventID LEFT JOIN wcf" . WCF_N . "_object_type object_type - ON (object_type.objectTypeID = notification_event.objectTypeID) + ON object_type.objectTypeID = notification_event.objectTypeID WHERE notification.notificationID = ? ORDER BY notification.time DESC"; $statement = WCF::getDB()->prepareStatement($sql, 1); diff --git a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php index 323be270f9..202433d3e3 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php @@ -30,8 +30,8 @@ class ArticleCommentListBoxController extends AbstractCommentListBoxController { $accessibleCategoryIDs = ArticleCategory::getAccessibleCategoryIDs(); if (!empty($accessibleCategoryIDs)) { - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article_content article_content ON (article_content.articleContentID = comment.objectID)'; - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article article ON (article.articleID = article_content.articleID)'; + $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article_content article_content ON article_content.articleContentID = comment.objectID'; + $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article article ON article.articleID = article_content.articleID'; $commentList->sqlSelects = 'article_content.title'; $commentList->getConditionBuilder()->add('article.categoryID IN (?)', [$accessibleCategoryIDs]); diff --git a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php index abc79e77b7..0d86022da4 100644 --- a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php +++ b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php @@ -84,7 +84,7 @@ class BoxHandler extends SingletonFactory $sql = "SELECT objectTypeID FROM wcf" . WCF_N . "_object_type object_type INNER JOIN wcf" . WCF_N . "_object_type_definition object_type_definition - ON (object_type.definitionID = object_type_definition.definitionID) + ON object_type.definitionID = object_type_definition.definitionID WHERE objectType = ? AND definitionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php index a9df6aeddd..e0d37466fe 100644 --- a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php @@ -33,7 +33,7 @@ class ProfileCommentListBoxController extends AbstractCommentListBoxController if (WCF::getSession()->getPermission('user.profile.canViewUserProfile')) { $optionID = User::getUserOptionID('canViewProfile'); - $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON (user_option_value.userID = comment.objectID)'; + $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON user_option_value.userID = comment.objectID'; if (WCF::getUser()->userID) { $followers = UserProfileHandler::getInstance()->getFollowers(); diff --git a/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php index c91f054baf..d71c982068 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php @@ -28,7 +28,7 @@ class BBCodeCacheBuilder extends AbstractCacheBuilder $sql = "SELECT attribute.*, bbcode.bbcodeTag FROM wcf" . WCF_N . "_bbcode_attribute attribute LEFT JOIN wcf" . WCF_N . "_bbcode bbcode - ON (bbcode.bbcodeID = attribute.bbcodeID) + ON bbcode.bbcodeID = attribute.bbcodeID ORDER BY attribute.attributeNo"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); diff --git a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php index 90eeeb249d..b1997855fd 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php @@ -21,7 +21,7 @@ class CategoryCacheBuilder extends AbstractCacheBuilder { $list = new CategoryList(); $list->sqlSelects = "object_type.objectType"; - $list->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_object_type object_type ON (object_type.objectTypeID = category.objectTypeID)"; + $list->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_object_type object_type ON object_type.objectTypeID = category.objectTypeID"; $list->sqlOrderBy = "category.showOrder ASC"; $list->readObjects(); 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 d60459245c..3a6a4deeb9 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -252,7 +252,7 @@ class RoutingCacheBuilder extends AbstractCacheBuilder $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 - ON (page.pageID = page_content.pageID)"; + ON page.pageID = page_content.pageID"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php index a55780876a..02db02e7b0 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php @@ -61,7 +61,7 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder $sql = "SELECT option_table.optionName, option_table.optionType, option_value.optionValue, option_value.groupID, option_table.enableOptions FROM wcf" . WCF_N . "_user_group_option_value option_value LEFT JOIN wcf" . WCF_N . "_user_group_option option_table - ON (option_table.optionID = option_value.optionID) + ON option_table.optionID = option_value.optionID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php index d80ef5c891..af4322a9d8 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php @@ -26,7 +26,7 @@ class UserNotificationEventCacheBuilder extends AbstractCacheBuilder $sql = "SELECT event.*, object_type.objectType FROM wcf" . WCF_N . "_user_notification_event event LEFT JOIN wcf" . WCF_N . "_object_type object_type - ON (object_type.objectTypeID = event.objectTypeID)"; + ON object_type.objectTypeID = event.objectTypeID"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php index aeba23a330..100d88a334 100644 --- a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php +++ b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php @@ -269,10 +269,8 @@ class CommentHandler extends SingletonFactory $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_comment comment - ON ( - comment.commentID = user_notification.objectID - AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)) . " - )"; + ON comment.commentID = user_notification.objectID + AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)); $notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]); $notificationList->getConditionBuilder()->add('comment.time <= ?', [$time]); $notificationList->readObjects(); @@ -320,10 +318,8 @@ class CommentHandler extends SingletonFactory $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_comment comment - ON ( - comment.commentID = user_notification.baseObjectID - AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)) . " - )"; + ON comment.commentID = user_notification.baseObjectID + AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)); $notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]); $notificationList->getConditionBuilder()->add('comment.time <= ?', [$time]); $notificationList->readObjects(); @@ -371,9 +367,9 @@ class CommentHandler extends SingletonFactory $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_comment_response comment_response - ON (comment_response.responseID = user_notification.objectID) + ON comment_response.responseID = user_notification.objectID LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID)"; + ON comment.commentID = comment_response.commentID"; $notificationList->getConditionBuilder()->add( 'comment.objectTypeID IN (?)', [$this->getObjectTypeID($objectType)] @@ -425,9 +421,9 @@ class CommentHandler extends SingletonFactory $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_comment_response comment_response - ON (comment_response.responseID = user_notification.baseObjectID) + ON comment_response.responseID = user_notification.baseObjectID LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID)"; + ON comment.commentID = comment_response.commentID"; $notificationList->getConditionBuilder()->add( 'comment.objectTypeID IN (?)', [$this->getObjectTypeID($objectType)] diff --git a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php index d43ed736d9..07348026c3 100644 --- a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php @@ -71,9 +71,9 @@ class DailyMailNotificationCronjob extends AbstractCronjob $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType FROM wcf" . WCF_N . "_user_notification notification LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event - ON (notification_event.eventID = notification.eventID) + ON notification_event.eventID = notification.eventID LEFT JOIN wcf" . WCF_N . "_object_type object_type - ON (object_type.objectTypeID = notification_event.objectTypeID) + ON object_type.objectTypeID = notification_event.objectTypeID " . $conditions . " ORDER BY notification.time"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php index 2a21bd441f..2762604686 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php @@ -48,7 +48,7 @@ class ExpiringPaidSubscriptionUserCronjob extends AbstractCronjob ); $paidSubscriptionUserList = new PaidSubscriptionUserList(); - $paidSubscriptionUserList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_user.subscriptionID)"; + $paidSubscriptionUserList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; $paidSubscriptionUserList->getConditionBuilder()->add('paid_subscription_user.endDate <> ?', [0]); $paidSubscriptionUserList->getConditionBuilder()->add( '(' . $conditionBuilder . ')', diff --git a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php index 53a0f2a456..1ca992806d 100644 --- a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php +++ b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php @@ -112,7 +112,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction $sql = "SELECT import_mapping.newID FROM wcf" . WCF_N . "_import_mapping import_mapping - " . ($tableName ? "LEFT JOIN " . $tableName . " object_table ON (object_table." . $indexName . " = import_mapping.newID)" : '') . " + " . ($tableName ? "LEFT JOIN " . $tableName . " object_table ON object_table." . $indexName . " = import_mapping.newID" : '') . " WHERE import_mapping.importHash = ? AND import_mapping.objectTypeID = ? AND import_mapping.oldID = ? diff --git a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php index 6128ef44dc..d66b689ece 100644 --- a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php +++ b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php @@ -181,11 +181,9 @@ class LikeHandler extends SingletonFactory CASE WHEN like_table.likeValue IS NOT NULL THEN like_table.likeValue ELSE 0 END AS liked FROM wcf" . WCF_N . "_like_object like_object LEFT JOIN wcf" . WCF_N . "_like like_table - ON ( - like_table.objectTypeID = ? - AND like_table.objectID = like_object.objectID - AND like_table.userID = ? - ) + ON like_table.objectTypeID = ? + AND like_table.objectID = like_object.objectID + AND like_table.userID = ? WHERE like_object.likeObjectID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php index f24ee7101a..b663049e87 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php @@ -52,7 +52,7 @@ class AbstractCommentResponseModerationQueueHandler extends AbstractCommentComme $sql = "SELECT comment_response.responseID, comment.commentID, comment.objectTypeID, comment.objectID FROM wcf" . WCF_N . "_comment_response comment_response LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID) + ON comment.commentID = comment_response.commentID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index 2270ec0064..d8aadddb25 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -238,7 +238,7 @@ class ModerationQueueManager extends SingletonFactory $sql = "SELECT COUNT(*) FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue - ON (moderation_queue.queueID = moderation_queue_to_user.queueID) + ON moderation_queue.queueID = moderation_queue_to_user.queueID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); @@ -284,13 +284,11 @@ class ModerationQueueManager extends SingletonFactory $sql = "SELECT COUNT(*) FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue - ON (moderation_queue.queueID = moderation_queue_to_user.queueID) + ON moderation_queue.queueID = moderation_queue_to_user.queueID LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit - ON ( - tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " - AND tracked_visit.objectID = moderation_queue.queueID - AND tracked_visit.userID = " . WCF::getUser()->userID . " - ) + ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " + AND tracked_visit.objectID = moderation_queue.queueID + AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); @@ -309,7 +307,7 @@ class ModerationQueueManager extends SingletonFactory protected function forceUserAssignment() { $queueList = new ModerationQueueList(); - $queueList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user ON (moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID . ")"; + $queueList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user ON moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID; $queueList->getConditionBuilder()->add("moderation_queue_to_user.queueID IS NULL"); $queueList->readObjects(); @@ -367,7 +365,7 @@ class ModerationQueueManager extends SingletonFactory $sql = "SELECT moderation_queue.queueID, moderation_queue.objectTypeID, moderation_queue.objectID FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue - ON (moderation_queue.queueID = moderation_queue_to_user.queueID) + ON moderation_queue.queueID = moderation_queue_to_user.queueID WHERE moderation_queue_to_user.userID = ? AND moderation_queue_to_user.isAffected = ? AND moderation_queue.status <> ?"; diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 991d25e328..234a33db1f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -710,7 +710,7 @@ class PackageArchive $sql = "SELECT package.* FROM wcf" . WCF_N . "_package_requirement requirement LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = requirement.requirement) + ON package.packageID = requirement.requirement WHERE requirement.packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->package->packageID]); @@ -921,7 +921,7 @@ class PackageArchive $sql = "SELECT package.*, package_exclusion.* FROM wcf" . WCF_N . "_package_exclusion package_exclusion LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = package_exclusion.packageID) + ON package.packageID = package_exclusion.packageID WHERE excludedPackage = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->packageInfo['name']]); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php index 04f0cbcb4d..b4fd2af82d 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php @@ -393,11 +393,11 @@ class PackageInstallationScheduler package_update.package FROM wcf" . WCF_N . "_package_update_exclusion package_update_exclusion LEFT JOIN wcf" . WCF_N . "_package_update_version package_update_version - ON (package_update_version.packageUpdateVersionID = package_update_exclusion.packageUpdateVersionID) + ON package_update_version.packageUpdateVersionID = package_update_exclusion.packageUpdateVersionID LEFT JOIN wcf" . WCF_N . "_package_update package_update - ON (package_update.packageUpdateID = package_update_version.packageUpdateID) + ON package_update.packageUpdateID = package_update_version.packageUpdateID LEFT JOIN wcf" . WCF_N . "_package package - ON (package.package = package_update_exclusion.excludedPackage) + ON package.package = package_update_exclusion.excludedPackage WHERE package_update_exclusion.packageUpdateVersionID IN ( SELECT packageUpdateVersionID FROM wcf" . WCF_N . "_package_update_version @@ -445,7 +445,7 @@ class PackageInstallationScheduler $sql = "SELECT package.*, package_exclusion.* FROM wcf" . WCF_N . "_package_exclusion package_exclusion LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = package_exclusion.packageID) + ON package.packageID = package_exclusion.packageID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); @@ -569,7 +569,7 @@ class PackageInstallationScheduler $sql = "SELECT puv.packageVersion, puf.fromversion FROM wcf" . WCF_N . "_package_update_fromversion puf LEFT JOIN wcf" . WCF_N . "_package_update_version puv - ON (puv.packageUpdateVersionID = puf.packageUpdateVersionID) + ON puv.packageUpdateVersionID = puf.packageUpdateVersionID WHERE puf.packageUpdateVersionID IN ( SELECT packageUpdateVersionID FROM wcf" . WCF_N . "_package_update_version diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 1a6e49bf13..349b797ceb 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -785,7 +785,8 @@ class PackageUpdateDispatcher extends SingletonFactory puv.packageUpdateVersionID, puv.packageDate, puv.filename, puv.packageVersion FROM wcf" . WCF_N . "_package_update pu LEFT JOIN wcf" . WCF_N . "_package_update_version puv - ON (puv.packageUpdateID = pu.packageUpdateID AND puv.isAccessible = 1) + ON puv.packageUpdateID = pu.packageUpdateID + AND puv.isAccessible = 1 " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); @@ -889,7 +890,7 @@ class PackageUpdateDispatcher extends SingletonFactory $sql = "SELECT pur.package, pur.minversion, p.packageID FROM wcf" . WCF_N . "_package_update_requirement pur LEFT JOIN wcf" . WCF_N . "_package p - ON (p.package = pur.package) + ON p.package = pur.package WHERE pur.packageUpdateVersionID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$packageUpdateVersionID]); @@ -955,9 +956,9 @@ class PackageUpdateDispatcher extends SingletonFactory $sql = "SELECT puv.*, pu.*, pus.serverURL, pus.loginUsername, pus.loginPassword FROM wcf" . WCF_N . "_package_update_version puv LEFT JOIN wcf" . WCF_N . "_package_update pu - ON (pu.packageUpdateID = puv.packageUpdateID) + ON pu.packageUpdateID = puv.packageUpdateID LEFT JOIN wcf" . WCF_N . "_package_update_server pus - ON (pus.packageUpdateServerID = pu.packageUpdateServerID) + ON pus.packageUpdateServerID = pu.packageUpdateServerID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php index b9cc39c9c6..10f0718481 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php @@ -214,7 +214,7 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $sql = "SELECT objectTypeID FROM wcf" . WCF_N . "_object_type object_type LEFT JOIN wcf" . WCF_N . "_object_type_definition object_type_definition - ON (object_type_definition.definitionID = object_type.definitionID) + ON object_type_definition.definitionID = object_type.definitionID WHERE objectType = ? AND definitionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php index 4b2842885b..ad4c32c8e2 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php @@ -257,7 +257,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl language_category.languageCategory FROM wcf" . WCF_N . "_language_category language_category LEFT JOIN wcf" . WCF_N . "_language_item item - ON (item.languageCategoryID = language_category.languageCategoryID) + ON item.languageCategoryID = language_category.languageCategoryID " . $conditions . " GROUP BY language_category.languageCategoryID ASC, language_category.languageCategory ASC"; diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php index acf7f39956..85bb5d239e 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php @@ -65,7 +65,7 @@ class TemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugi template_group.templateGroupFolderName FROM wcf" . WCF_N . "_template template LEFT JOIN wcf" . WCF_N . "_template_group template_group - ON (template_group.templateGroupID = template.templateGroupID) + ON template_group.templateGroupID = template.templateGroupID WHERE packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->installation->getPackageID()]); diff --git a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php index b66d2fc494..39ba7e5210 100644 --- a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php @@ -316,7 +316,7 @@ class PackageValidationArchive implements \RecursiveIterator $sql = "SELECT package.*, package_exclusion.* FROM wcf" . WCF_N . "_package_exclusion package_exclusion LEFT JOIN wcf" . WCF_N . "_package package - ON (package.packageID = package_exclusion.packageID) + ON package.packageID = package_exclusion.packageID WHERE excludedPackage = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->getArchive()->getPackageInfo('name')]); diff --git a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php index abac85b13b..4ae33e8d26 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php @@ -114,7 +114,7 @@ trait TDecoratedCategoryLookupPageHandler $sql = "SELECT DISTINCT categoryID FROM wcf" . WCF_N . "_category category LEFT JOIN wcf" . WCF_N . "_language_item language_item - ON (language_item.languageItem = category.title) + ON language_item.languageItem = category.title " . $conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql, 10); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php index fa9b20b4cf..eac7518475 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php @@ -50,7 +50,7 @@ class TrophyPageHandler extends AbstractLookupPageHandler if (!empty($trophyList->sqlJoins)) { $trophyList->sqlJoins .= ', '; } - $trophyList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language_item language_item ON (language_item.languageItem = trophy.title)"; + $trophyList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language_item language_item ON language_item.languageItem = trophy.title"; $trophyList->getConditionBuilder()->add( '(trophy.title LIKE ? OR language_item.languageItemValue LIKE ?)', ['%' . $searchString . '%', '%' . $searchString . '%'] diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 18b706c247..6efe7b8f0e 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -431,7 +431,7 @@ class PollManager extends SingletonFactory // check for user votes if (WCF::getUser()->userID) { $optionList->sqlSelects = "CASE WHEN poll_option_vote.optionID IS NULL THEN '0' ELSE '1' END AS voted"; - $optionList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote ON (poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID . ")"; + $optionList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote ON poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID; } else { $optionList->sqlSelects = "'0' AS voted"; } diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index 00761177c1..18959729d4 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -280,11 +280,9 @@ class ReactionHandler extends SingletonFactory COALESCE(like_table.likeValue, 0) AS liked FROM wcf" . WCF_N . "_like_object like_object LEFT JOIN wcf" . WCF_N . "_like like_table - ON ( - like_table.objectTypeID = like_object.objectTypeID - AND like_table.objectID = like_object.objectID - AND like_table.userID = ? - ) + ON like_table.objectTypeID = like_object.objectTypeID + AND like_table.objectID = like_object.objectID + AND like_table.userID = ? " . $conditions; \array_unshift($parameters, WCF::getUser()->userID); @@ -769,11 +767,9 @@ class ReactionHandler extends SingletonFactory COALESCE(like_table.likeValue, 0) AS liked FROM wcf" . WCF_N . "_like_object like_object LEFT JOIN wcf" . WCF_N . "_like like_table - ON ( - like_table.objectTypeID = ? - AND like_table.objectID = like_object.objectID - AND like_table.userID = ? - ) + ON like_table.objectTypeID = ? + AND like_table.objectID = like_object.objectID + AND like_table.userID = ? WHERE like_object.likeObjectID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php index 38740d1c2c..969317ce29 100644 --- a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php @@ -134,7 +134,7 @@ class ArticleSearch extends AbstractSearchableObjectType */ public function getJoins() { - return 'INNER JOIN wcf' . WCF_N . '_article ON (wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID)'; + return 'INNER JOIN wcf' . WCF_N . '_article ON wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID'; } /** diff --git a/wcfsetup/install/files/lib/system/search/PageSearch.class.php b/wcfsetup/install/files/lib/system/search/PageSearch.class.php index f495ad964e..bb7d8f2902 100644 --- a/wcfsetup/install/files/lib/system/search/PageSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/PageSearch.class.php @@ -142,7 +142,7 @@ class PageSearch extends AbstractSearchableObjectType */ public function getJoins() { - return 'INNER JOIN wcf' . WCF_N . '_page ON (wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID)'; + return 'INNER JOIN wcf' . WCF_N . '_page ON wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID'; } /** diff --git a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php index 0d26d601dd..2d66c00ec0 100644 --- a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php +++ b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php @@ -66,7 +66,7 @@ class MysqlSearchEngine extends AbstractSearchEngine " . ($orderBy == 'relevance ASC' || $orderBy == 'relevance DESC' ? ',search_index.relevance' : '') . " FROM " . $objectType->getTableName() . " INNER JOIN ({WCF_SEARCH_INNER_JOIN}) search_index - ON (" . $objectType->getIDFieldName() . " = search_index.objectID) + ON " . $objectType->getIDFieldName() . " = search_index.objectID " . $objectType->getJoins() . " " . ($additionalConditions[$objectTypeName] ?? ''); } diff --git a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php index 7a553a04fe..faae58838c 100644 --- a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php +++ b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php @@ -38,8 +38,8 @@ class MultilingualPageSitemapObject extends AbstractSitemapObjectObjectType /** @var $pageList PageContentList */ $pageList = parent::getObjectList(); - $pageList->sqlConditionJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON (page_content.pageID = page.pageID)'; - $pageList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON (page_content.pageID = page.pageID)'; + $pageList->sqlConditionJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID'; + $pageList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID'; $pageList->getConditionBuilder()->add('page.isMultilingual = ?', [1]); $pageList->getConditionBuilder()->add('page.allowSpidersToIndex = ?', [1]); diff --git a/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php index 8c6fe06d4d..ea2171e802 100644 --- a/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php @@ -42,7 +42,7 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler SELECT COUNT(*) FROM wcf" . WCF_N . "_comment_response comment_response LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID) + ON comment.commentID = comment_response.commentID WHERE comment.objectTypeID = ? AND comment_response.time BETWEEN ? AND ? )"; @@ -66,7 +66,7 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler SELECT COUNT(*) FROM wcf" . WCF_N . "_comment_response comment_response LEFT JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID) + ON comment.commentID = comment_response.commentID WHERE comment.objectTypeID = ? AND comment_response.time < ? )"; diff --git a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php index cbb233c3f8..1c2d04d89e 100644 --- a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php +++ b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php @@ -205,7 +205,7 @@ class TagEngine extends SingletonFactory $sql = "SELECT tag.*, tag_to_object.objectID FROM wcf" . WCF_N . "_tag_to_object tag_to_object LEFT JOIN wcf" . WCF_N . "_tag tag - ON (tag.tagID = tag_to_object.tagID) + ON tag.tagID = tag_to_object.tagID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); diff --git a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php index 947298cf1e..07dd292107 100644 --- a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php +++ b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php @@ -133,7 +133,7 @@ class TrophyConditionHandler extends SingletonFactory private function getUserIDs(Trophy $trophy) { $userList = new UserList(); - $userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; + $userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; $conditions = $trophy->getConditions(); foreach ($conditions as $condition) { @@ -192,7 +192,7 @@ class TrophyConditionHandler extends SingletonFactory $userList->sqlJoins = $pseudoUserList->sqlJoins; // We joining the user_trophy table to receive the userTrophyID, which should be deleted. - $userList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy ON (user_table.userID = user_trophy.userID)"; + $userList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy ON user_table.userID = user_trophy.userID"; // We do not need the complete user object, but only the userTrophyID. // So that the UserList object can also assign the users (which is used diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 515cdfaa60..4cb958896f 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -433,9 +433,9 @@ class UserNotificationHandler extends SingletonFactory $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType FROM wcf" . WCF_N . "_user_notification notification LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event - ON (notification_event.eventID = notification.eventID) + ON notification_event.eventID = notification.eventID LEFT JOIN wcf" . WCF_N . "_object_type object_type - ON (object_type.objectTypeID = notification_event.objectTypeID) + ON object_type.objectTypeID = notification_event.objectTypeID " . $conditions . " ORDER BY notification.time DESC"; $statement = WCF::getDB()->prepareStatement($sql, $limit, $offset); diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php index cb48f9dcdb..84c83069b6 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php @@ -42,7 +42,7 @@ class ArticleCommentUserNotificationObjectType extends AbstractUserNotificationO $sql = "SELECT article.userID FROM wcf" . WCF_N . "_comment comment LEFT JOIN wcf" . WCF_N . "_article article - ON (article.articleID = comment.objectID) + ON article.articleID = comment.objectID WHERE comment.commentID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$objectID]); diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php index fce6255e81..f36a41bc14 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php @@ -49,7 +49,7 @@ trait TMultiRecipientModerationQueueCommentUserNotificationObjectType SELECT DISTINCT comment_response.userID FROM wcf" . WCF_N . "_comment_response comment_response INNER JOIN wcf" . WCF_N . "_comment comment - ON (comment.commentID = comment_response.commentID) + ON comment.commentID = comment_response.commentID WHERE comment.objectID = ? AND comment.objectTypeID = ? )"; diff --git a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php index 748d465fc3..951b3a379f 100644 --- a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php @@ -141,7 +141,7 @@ class MailWorker extends AbstractWorker $sql = "SELECT user_option.*, user.* FROM wcf" . WCF_N . "_user user LEFT JOIN wcf" . WCF_N . "_user_option_value user_option - ON (user_option.userID = user.userID) + ON user_option.userID = user.userID " . $this->conditions . " ORDER BY user.userID"; $statement = WCF::getDB()->prepareStatement($sql, $this->limit, $this->limit * $this->loopCount); diff --git a/wcfsetup/install/files/lib/system/worker/UserActivityPointItemsRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserActivityPointItemsRebuildDataWorker.class.php index abad7a34f8..9f49b3e00d 100644 --- a/wcfsetup/install/files/lib/system/worker/UserActivityPointItemsRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserActivityPointItemsRebuildDataWorker.class.php @@ -55,7 +55,7 @@ class UserActivityPointItemsRebuildDataWorker extends AbstractRebuildDataWorker $sql = "UPDATE wcf" . WCF_N . "_user_activity_point user_activity_point LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = user_activity_point.userID) + ON user_table.userID = user_activity_point.userID SET user_activity_point.items = user_table.likesReceived, user_activity_point.activityPoints = user_activity_point.items * ? " . $conditionBuilder; diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index 0ad874e5a8..c93d4aee57 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -47,7 +47,7 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker parent::initObjectList(); $this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe'; - $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; + $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; $this->objectList->sqlOrderBy = 'user_table.userID'; } @@ -114,9 +114,9 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker SELECT COUNT(*) FROM wcf" . WCF_N . "_user_trophy user_trophy LEFT JOIN wcf" . WCF_N . "_trophy trophy - ON (user_trophy.trophyID = trophy.trophyID) + ON user_trophy.trophyID = trophy.trophyID LEFT JOIN wcf" . WCF_N . "_category trophy_category - ON (trophy.categoryID = trophy_category.categoryID) + ON trophy.categoryID = trophy_category.categoryID WHERE user_trophy.userID = user_table.userID AND trophy.isDisabled = 0 AND trophy_category.isDisabled = 0 diff --git a/wcfsetup/install/files/lib/util/MessageUtil.class.php b/wcfsetup/install/files/lib/util/MessageUtil.class.php index db992060b7..3204a965c4 100644 --- a/wcfsetup/install/files/lib/util/MessageUtil.class.php +++ b/wcfsetup/install/files/lib/util/MessageUtil.class.php @@ -165,7 +165,7 @@ class MessageUtil $sql = "SELECT user_table.username FROM wcf" . WCF_N . "_user_to_group user_to_group LEFT JOIN wcf" . WCF_N . "_user user_table - ON (user_table.userID = user_to_group.userID) + ON user_table.userID = user_to_group.userID " . $conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); -- 2.20.1