VirtualMailManager/VirtualMailManager.py
changeset 238 8f56166a3283
parent 231 8c4df3dd2d2c
child 258 9bf8d97ced88
--- a/VirtualMailManager/VirtualMailManager.py	Sun Mar 21 09:17:26 2010 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Mon Apr 05 10:22:51 2010 +0000
@@ -573,12 +573,7 @@
         if pattern is not None:
             if pattern.startswith('%') or pattern.endswith('%'):
                 like = True
-                if pattern.startswith('%') and pattern.endswith('%'):
-                    domain = pattern[1:-1]
-                elif pattern.startswith('%'):
-                    domain = pattern[1:]
-                elif pattern.endswith('%'):
-                    domain = pattern[:-1]
+                domain = pattern.strip('%')
                 if not re.match(RE_DOMAIN_SRCH, domain):
                     raise VMMException(
                     _(u"The pattern ā€œ%sā€ contains invalid characters.") %