mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: allows to query a username made of integers (#25815)
If a user had `123456789` as username, it could be passed to the query as a number and the query would fail as it expects a string. Also applies the same fix to groups.
This commit is contained in:
@ -9,8 +9,8 @@ module Chat
|
||||
.where(user_options: { chat_enabled: true })
|
||||
.where(
|
||||
"username IN (?) OR (groups.name IN (?) AND group_users.user_id IS NOT NULL)",
|
||||
usernames,
|
||||
groups,
|
||||
usernames&.map(&:to_s),
|
||||
groups&.map(&:to_s),
|
||||
)
|
||||
.where.not(id: excluded_user_ids)
|
||||
.distinct
|
||||
|
Reference in New Issue
Block a user