Fix #3978: Pool name/category validations not being enforced.

This commit is contained in:
evazion
2018-11-07 16:10:16 -06:00
parent a6aa75873d
commit 1281481548
3 changed files with 42 additions and 11 deletions

View File

@@ -144,6 +144,11 @@ module Danbooru
2
end
# Members cannot change the category of pools with more than this many posts.
def pool_category_change_limit
100
end
# Whether safe mode should be enabled. Safe mode hides all non-rating:safe posts from view.
def enable_safe_mode?(request, user)
!!(request.host =~ /safe/ || request.params[:safe_mode] || user.enable_safe_mode?)