fixes #34: case sensitive blacklisted tags
This commit is contained in:
@@ -25,6 +25,7 @@ class User < ActiveRecord::Base
|
||||
validates_presence_of :email, :if => lambda {|rec| rec.new_record? && Danbooru.config.enable_email_verification?}
|
||||
validate :validate_ip_addr_is_not_banned, :on => :create
|
||||
before_validation :convert_blank_email_to_null
|
||||
before_validation :normalize_blacklisted_tags
|
||||
before_save :encrypt_password
|
||||
after_save :update_cache
|
||||
before_create :promote_to_admin_if_first_user
|
||||
@@ -247,6 +248,10 @@ class User < ActiveRecord::Base
|
||||
def blacklisted_tag_array
|
||||
Tag.scan_query(blacklisted_tags)
|
||||
end
|
||||
|
||||
def normalize_blacklisted_tags
|
||||
self.blacklisted_tags = blacklisted_tags.downcase if blacklisted_tags.present?
|
||||
end
|
||||
end
|
||||
|
||||
module ForumMethods
|
||||
|
||||
Reference in New Issue
Block a user