From 55497e58534ca146d294fa8519707c7d9dbd2c05 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 28 Mar 2013 11:42:07 -0400 Subject: [PATCH] disable pixiv source searches --- app/logical/post_query_builder.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index ac2971ccc..5f2dfd8ec 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -124,7 +124,6 @@ class PostQueryBuilder relation = add_range_relation(q[:copyright_tag_count], "posts.tag_count_copyright", relation) relation = add_range_relation(q[:character_tag_count], "posts.tag_count_character", relation) relation = add_range_relation(q[:post_tag_count], "posts.tag_count", relation) - relation = add_range_relation(q[:pixiv], "substring(posts.source, 'pixiv.net/img.*/([0-9]+)[^/]*$')::integer", relation) if q[:md5] relation = relation.where(["posts.md5 IN (?)", q[:md5]]) @@ -154,12 +153,8 @@ class PostQueryBuilder if q[:source] if q[:source] == "none%" relation = relation.where("(posts.source = '' OR posts.source IS NULL)") - elsif q[:source] =~ /^(pixiv\/|%\.?pixiv(\.net(\/img)?)?(%\/|(?=%$)))(.+)$/ - if $5 == "%" - relation = relation.where("substring(posts.source, 'pixiv.net/img.*/([^/]*/[^/]*)$') IS NOT NULL") - else - relation = relation.where("substring(posts.source, 'pixiv.net/img.*/([^/]*/[^/]*)$') LIKE ? ESCAPE E'\\\\'", $5) - end + elsif q[:source] =~ /pixiv/ + raise ::Post::SearchError.new("pixiv source searches temporarily disabled") has_constraints! else relation = relation.where("posts.source LIKE ? ESCAPE E'\\\\'", q[:source])