fixed issue #968, IS_MATCH validator bug with unicode, thanks alex0834
This commit is contained in:
+5
-2
@@ -200,8 +200,11 @@ class IS_MATCH(Validator):
|
|||||||
self.is_unicode = is_unicode
|
self.is_unicode = is_unicode
|
||||||
|
|
||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
if self.is_unicode and not isinstance(value, unicode):
|
if self.is_unicode:
|
||||||
match = self.regex.search(str(value).decode('utf8'))
|
if isinstance(value,unicode):
|
||||||
|
match = self.regex.search(value)
|
||||||
|
else:
|
||||||
|
match = self.regex.search(str(value).decode('utf8'))
|
||||||
else:
|
else:
|
||||||
match = self.regex.search(str(value))
|
match = self.regex.search(str(value))
|
||||||
if match is not None:
|
if match is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user