Fix #4582: Safebooru should not block "censored" tag
* Remove the default list of blocked tags in safe mode. * Change it so that tags that are blocked in safe mode are filtered out at the database level rather than at the html level.
This commit is contained in:
@@ -36,7 +36,7 @@ module PostSets
|
||||
# The description of the page for the <meta name="description"> tag.
|
||||
def meta_description
|
||||
# XXX post_count may be nil if the search times out because of safe mode
|
||||
if normalized_query.is_simple_tag? && post_count.present?
|
||||
if post_query.is_simple_tag? && post_count.present?
|
||||
humanized_count = ApplicationController.helpers.humanized_number(post_count, million: " million", thousand: " thousand")
|
||||
humanized_count = "over #{humanized_count}" if post_count >= 1_000
|
||||
|
||||
@@ -106,7 +106,8 @@ module PostSets
|
||||
end
|
||||
|
||||
def posts
|
||||
@posts ||= normalized_query.paginated_posts(page, includes: includes, count: post_count, search_count: !post_count.nil?, limit: per_page, max_limit: max_per_page).load
|
||||
post_query.validate_tag_limit!
|
||||
normalized_query.paginated_posts(page, includes: includes, count: post_count, search_count: !post_count.nil?, limit: per_page, max_limit: max_per_page).load
|
||||
end
|
||||
|
||||
# @return [Integer, nil] The number of posts returned by the search, or nil if unknown.
|
||||
@@ -197,6 +198,6 @@ module PostSets
|
||||
end
|
||||
end
|
||||
|
||||
memoize :page_title
|
||||
memoize :page_title, :posts
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user