Fix detection of tag wildcard searches

This commit is contained in:
Toks
2014-07-30 16:29:55 -04:00
parent 6666cf9050
commit 2b3909496a

View File

@@ -63,7 +63,7 @@ module PostSets
end end
def posts def posts
if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/} && !CurrentUser.user.is_builder? if tag_array.any? {|x| x =~ /^-?source:.*\*.*pixiv/} && !CurrentUser.user.is_builder?
raise SearchError.new("Your search took too long to execute and was canceled") raise SearchError.new("Your search took too long to execute and was canceled")
end end
@@ -87,7 +87,7 @@ module PostSets
end end
def is_pattern_search? def is_pattern_search?
is_single_tag? && tag_string =~ /\*/ is_single_tag? && tag_string =~ /\*/ && !tag_array.any? {|x| x =~ /^-?source:.+/}
end end
def current_page def current_page