From 2ed2f44a522736146cae7293368b7464a0670c2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 13 May 2022 11:14:19 +0200 Subject: [PATCH] Use a `?` placeholder for the `USER_SESSION_LIMIT` in SessionHandler MySQL supports placeholders within the `LIMIT`, make use of this to avoid the string concatenation that breaks syntax highlighting of the SQL query within the IDE. --- .../install/files/lib/system/session/SessionHandler.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 248d63be04..4a5e23f38c 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -1072,7 +1072,7 @@ final class SessionHandler extends SingletonFactory FROM wcf1_user_session WHERE userID = ? ORDER BY lastActivityTime DESC - LIMIT " . self::USER_SESSION_LIMIT . " + LIMIT ? ) newest_sessions ON newest_sessions.sessionID = all_sessions.sessionID WHERE all_sessions.userID = ? @@ -1080,6 +1080,7 @@ final class SessionHandler extends SingletonFactory $statement = WCF::getDB()->prepare($sql); $statement->execute([ $user->userID, + self::USER_SESSION_LIMIT, $user->userID, ]); foreach ($statement->fetchAll(\PDO::FETCH_COLUMN) as $sessionID) { -- 2.20.1