From dec19b25cdf21b81d73c5897cd3c885d5ec62ef4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Mar 2021 12:16:06 +0100 Subject: [PATCH] Add whitespace before condition in UserSearchForm Currently a query like the following is generated: SELECT user_table.userID FROM wcf1_user user_table LEFT JOIN wcf1_user_option_value option_value ON (option_value.userID = user_table.userID)WHERE option_value.userOption4 = ? This works due to the parentheses around the `ON` part of the `JOIN`, but it certainly is not pretty and it will cause issues if the parentheses are removed (as it happened for WoltLab Suite 5.4). Insert a newline between the base query and the condition to fix the issue. Resolves #4078 Co-Authored-By: mutec --- wcfsetup/install/files/lib/form/UserSearchForm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/form/UserSearchForm.class.php index 7220471768..9583b960a3 100644 --- a/wcfsetup/install/files/lib/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/form/UserSearchForm.class.php @@ -175,7 +175,7 @@ class UserSearchForm extends UserOptionListForm { } // do search - $statement = WCF::getDB()->prepareStatement($sql.$this->conditions, $this->maxResults); + $statement = WCF::getDB()->prepareStatement($sql."\n".$this->conditions, $this->maxResults); $statement->execute($this->conditions->getParameters()); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); } -- 2.20.1