Added support for backets in tag names

This commit is contained in:
Marcin Kurczewski 2013-11-29 10:42:56 +01:00
parent 4648b6afca
commit 2a625db683

View file

@ -73,7 +73,7 @@ class Model_Tag extends AbstractModel
if (strlen($tag) > $maxLength) if (strlen($tag) > $maxLength)
throw new SimpleException('Tag must have at most ' . $maxLength . ' characters'); throw new SimpleException('Tag must have at most ' . $maxLength . ' characters');
if (!preg_match('/^[a-zA-Z0-9_.-]+$/i', $tag)) if (!preg_match('/^[()\[\]a-zA-Z0-9_.-]+$/i', $tag))
throw new SimpleException('Invalid tag "' . $tag . '"'); throw new SimpleException('Invalid tag "' . $tag . '"');
if (preg_match('/^\.\.?$/', $tag)) if (preg_match('/^\.\.?$/', $tag))