Fix #5346: Can add tags beginning with newpool:, causing the next edit to add the post to a pool.

This commit is contained in:
evazion
2022-11-12 17:01:52 -06:00
parent 86669fa605
commit 220db642e1
2 changed files with 12 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ class TagNameValidator < ActiveModel::EachValidator
record.errors.add(attribute, "'#{value}' must consist of only ASCII characters")
when /\A(#{PostQueryBuilder::METATAGS.join("|")}):(.+)\z/i
record.errors.add(attribute, "'#{value}' cannot begin with '#{$1}:'")
when /\A(#{Tag.categories.regexp}):(.+)\z/i
when /\A(#{PostEdit::METATAGS.join("|")}):(.+)\z/i
record.errors.add(attribute, "'#{value}' cannot begin with '#{$1}:'")
when "new", "search", "and", "or", "not"
record.errors.add(attribute, "'#{value}' is a reserved name and cannot be used")