refactored tsquery sql to use rails escaping mechanisms
This commit is contained in:
@@ -938,8 +938,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def raw_tag_match(tag)
|
||||
tag = PostQueryBuilder.escape_string_for_tsquery(tag)
|
||||
where("posts.tag_index @@ to_tsquery('danbooru', E'" + tag + "')")
|
||||
where("posts.tag_index @@ to_tsquery('danbooru', E?)", tag.to_escaped_for_tsquery)
|
||||
end
|
||||
|
||||
def tag_match(query)
|
||||
|
||||
Reference in New Issue
Block a user