Module: check_mk
Branch: master
Commit: 0baf01cace9c8247631b12ba872973fea9c6dd04
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0baf01cace9c82…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sat May 26 18:31:26 2018 +0200
6177 FIX Correctly escaping output of inventory data based painters
Change-Id: I315385229771c551c17dadbec14619f12f36341c
---
.werks/6177 | 11 +++++++++++
web/plugins/views/inventory.py | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/6177 b/.werks/6177
new file mode 100644
index 0000000..21373d6
--- /dev/null
+++ b/.werks/6177
@@ -0,0 +1,11 @@
+Title: Correctly escaping output of inventory data based painters
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527352246
+
+
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index 6eaa7e1..da26d3d 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -182,9 +182,9 @@ def inv_paint_generic(v):
if isinstance(v, float):
return "number", "%.2f" % v
elif isinstance(v, int):
- return "number", str(v)
+ return "number", "%d" % v
else:
- return "", str(v)
+ return "", html.escaper.escape_text("%s" % v)
@decorate_inv_paint