tags: don't allow tags with unbalanced parentheses.
Don't allow tags to have unbalanced parentheses, except for a few emoticon tags as special exceptions to the rule.
This commit is contained in:
@@ -147,6 +147,16 @@ class TagTest < ActiveSupport::TestCase
|
||||
should allow_value("foo bar").for(:name).on(:create)
|
||||
should allow_value("FOO").for(:name).on(:create)
|
||||
|
||||
should allow_value(":)").for(:name).on(:create)
|
||||
should allow_value(":(").for(:name).on(:create)
|
||||
should allow_value(";)").for(:name).on(:create)
|
||||
should allow_value(";(").for(:name).on(:create)
|
||||
should allow_value(">:)").for(:name).on(:create)
|
||||
should allow_value(">:(").for(:name).on(:create)
|
||||
|
||||
should allow_value("foo_(bar)").for(:name).on(:create)
|
||||
should allow_value("foo_(bar_(baz))").for(:name).on(:create)
|
||||
|
||||
should_not allow_value("").for(:name).on(:create)
|
||||
should_not allow_value("___").for(:name).on(:create)
|
||||
should_not allow_value("~foo").for(:name).on(:create)
|
||||
@@ -154,6 +164,7 @@ class TagTest < ActiveSupport::TestCase
|
||||
should_not allow_value("/foo").for(:name).on(:create)
|
||||
should_not allow_value("`foo").for(:name).on(:create)
|
||||
should_not allow_value("%foo").for(:name).on(:create)
|
||||
should_not allow_value("(foo").for(:name).on(:create)
|
||||
should_not allow_value(")foo").for(:name).on(:create)
|
||||
should_not allow_value("{foo").for(:name).on(:create)
|
||||
should_not allow_value("}foo").for(:name).on(:create)
|
||||
@@ -169,6 +180,12 @@ class TagTest < ActiveSupport::TestCase
|
||||
should_not allow_value("FAV:blah").for(:name).on(:create)
|
||||
should_not allow_value("X"*171).for(:name).on(:create)
|
||||
|
||||
should_not allow_value("foo)").for(:name).on(:create)
|
||||
should_not allow_value("foo(").for(:name).on(:create)
|
||||
should_not allow_value("foo)(").for(:name).on(:create)
|
||||
should_not allow_value("foo(()").for(:name).on(:create)
|
||||
should_not allow_value("foo())").for(:name).on(:create)
|
||||
|
||||
metatags = PostQueryBuilder::METATAGS + TagCategory.mapping.keys
|
||||
metatags.each do |metatag|
|
||||
should_not allow_value("#{metatag}:foo").for(:name).on(:create)
|
||||
|
||||
Reference in New Issue
Block a user