mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 17:53:44 +08:00
Ensure we escape variables passed into our SQL query.
This commit is contained in:
parent
3c41cb6b7d
commit
10ec554d97
|
@ -308,9 +308,9 @@ class Search
|
|||
level = TopicUser.notification_levels[match.to_sym]
|
||||
posts.where("posts.topic_id IN (
|
||||
SELECT tu.topic_id FROM topic_users tu
|
||||
WHERE tu.user_id = #{@guardian.user.id} AND
|
||||
tu.notification_level >= #{level}
|
||||
)")
|
||||
WHERE tu.user_id = :user_id AND
|
||||
tu.notification_level >= :level
|
||||
)", user_id: @guardian.user.id, level: level)
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user