mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 22:23:45 +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]
|
level = TopicUser.notification_levels[match.to_sym]
|
||||||
posts.where("posts.topic_id IN (
|
posts.where("posts.topic_id IN (
|
||||||
SELECT tu.topic_id FROM topic_users tu
|
SELECT tu.topic_id FROM topic_users tu
|
||||||
WHERE tu.user_id = #{@guardian.user.id} AND
|
WHERE tu.user_id = :user_id AND
|
||||||
tu.notification_level >= #{level}
|
tu.notification_level >= :level
|
||||||
)")
|
)", user_id: @guardian.user.id, level: level)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user