Module: check_mk
Branch: master
Commit: 3ddb3e3a71538c9b743bc0f07d6616242f8640c2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ddb3e3a71538c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jun 24 11:23:03 2014 +0200
TextAscii: disallow non-ascii characters
---
web/htdocs/valuespec.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 31afeab..c3997b5 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -390,6 +390,10 @@ class TextAscii(ValueSpec):
type_name(value))
def validate_value(self, value, varprefix):
+ try:
+ unicode(value)
+ except:
+ raise MKUserError(varprefix, _("Non-ASCII characters are not allowed
here."))
if self._none_is_empty and value == "":
raise MKUserError(varprefix, _("An empty value must be represented with
None here."))
if not self._allow_empty and value.strip() == "":