This commit is contained in:
albert
2013-04-04 18:24:06 -04:00
parent 79c0c481cd
commit e0a5b748d9
3 changed files with 5 additions and 3 deletions

View File

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