Fix missing ) causing some source searches to fail

This commit is contained in:
Kevin Xiwei Zheng
2014-01-28 01:32:35 -05:00
parent 744daa6c0c
commit db5f14efd0

View File

@@ -171,7 +171,7 @@ class PostQueryBuilder
if q[:source] == "none%"
relation = relation.where("(posts.source = '' OR posts.source IS NULL)")
elsif q[:source] == "http%"
relation = relation.where("(lower(posts.source) like ?", "http%")
relation = relation.where("(lower(posts.source) like ?)", "http%")
elsif q[:source] =~ /^%\.?pixiv(?:\.net(?:\/img)?)?(?:%\/|(?=%$))(.+)$/i
relation = relation.where("SourcePattern(lower(posts.source)) LIKE lower(?) ESCAPE E'\\\\'", "pixiv/" + $1)
has_constraints!