Fix #3928: fix case sensitivity in metatags.

This commit is contained in:
evazion
2018-09-27 23:42:30 -05:00
parent 6a375d04e0
commit 984cd0432c
3 changed files with 7 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class TagNameValidator < ActiveModel::EachValidator
record.errors[attribute] << "'#{value}' cannot contain non-printable characters"
when /[^[[:ascii:]]]/
record.errors[attribute] << "'#{value}' must consist of only ASCII characters"
when /\A(#{Regexp.union(Tag::METATAGS)}):(.+)\z/i
when /\A(#{Tag::METATAGS.join("|")}):(.+)\z/i
record.errors[attribute] << "'#{value}' cannot begin with '#{$1}:'"
when /\A(#{Tag.categories.regexp}):(.+)\z/i
record.errors[attribute] << "'#{value}' cannot begin with '#{$1}:'"