From 2b74e47abbed6c0637ed4aca19689e1c3871ca7e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 16 Feb 2020 18:06:29 +0100 Subject: [PATCH] Incorrect usage of `NOT IN()` for columns that accept `NULL` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit `NULL` is considered to fail the condition `NOT IN (1, 2, …)`. --- .../lib/system/box/AbstractCommentListBoxController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php index ce1eb865e7..cd4a0f60c6 100644 --- a/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php @@ -86,7 +86,7 @@ abstract class AbstractCommentListBoxController extends AbstractDatabaseObjectLi $this->applyObjectTypeFilters($commentList); if (!empty(UserProfileHandler::getInstance()->getIgnoredUsers())) { - $commentList->getConditionBuilder()->add("comment.userID NOT IN (?)", [UserProfileHandler::getInstance()->getIgnoredUsers()]); + $commentList->getConditionBuilder()->add("(comment.userID IS NULL OR comment.userID NOT IN (?))", [UserProfileHandler::getInstance()->getIgnoredUsers()]); } return $commentList; -- 2.20.1