From: Tim Düsterhus Date: Mon, 15 Mar 2021 11:16:06 +0000 (+0100) Subject: Add whitespace before condition in UserSearchForm X-Git-Tag: 5.3.6~49 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dec19b25cdf21b81d73c5897cd3c885d5ec62ef4;p=GitHub%2FWoltLab%2FWCF.git 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 --- 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); }