Module: check_mk
Branch: master
Commit: 00c3cf12fa7fe8b21f77c4a97f7f4a67933253fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=00c3cf12fa7fe8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 4 09:57:56 2016 +0200
3757 FIX Bulk import: Ensuring non ASCII characters are not imported into regular
attributes
---
.werks/3757 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/.werks/3757 b/.werks/3757
new file mode 100644
index 0000000..f299464
--- /dev/null
+++ b/.werks/3757
@@ -0,0 +1,10 @@
+Title: Bulk import: Ensuring non ASCII characters are not imported into regular
attributes
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1470297437
+
+
diff --git a/ChangeLog b/ChangeLog
index c0db3eb..85510f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -526,6 +526,7 @@
* 3754 FIX: Cluster nodes are now correctly validated for invalid characters
* 3755 FIX: Preventing to insert non ASCII characters in host addresses now
* 3756 FIX: Bulk import: Fixed exception when host name contained special characters
+ * 3757 FIX: Bulk import: Ensuring non ASCII characters are not imported into regular
attributes
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b4366b0..ca8bb11 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3198,6 +3198,11 @@ class ModeBulkImport(WatoMode):
if attribute == "alias":
attributes[attribute] = value.decode("utf-8")
else:
+ try:
+ unicode(value)
+ except:
+ raise MKUserError(None, _("Non-ASCII characters are not
allowed in the "
+ "attribute
\"%s\".") % attribute)
attributes[attribute] = value
if host_name == None: