Skip to content

Commit

Permalink
Merge pull request #3 from nicholasserra/dev/escape-regex-tags
Browse files Browse the repository at this point in the history
Regex escape tags in manager
  • Loading branch information
joestump committed Jan 17, 2013
2 parents fdb758e + e8be96b commit a586489
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion taggit/managers.py
Expand Up @@ -12,6 +12,8 @@
from taggit.utils import require_instance_manager
from taggit.signals import tags_add, tags_remove, tags_clear

import re


try:
all
Expand Down Expand Up @@ -180,7 +182,7 @@ def add(self, *tags):
# characters with IN syntax. ie: vidéo == video
existing = self.through.tag_model().objects.filter(
name__iregex = r'(%s)' % '|'.join(
['^%s$' % x for x in str_tags])
['^%s$' % re.escape(x) for x in str_tags])
)
else:
existing = {}
Expand Down

0 comments on commit a586489

Please sign in to comment.