Module: check_mk
Branch: master
Commit: ab693e8a4453e4af0ae7e7eeafe98972552f10fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab693e8a4453e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 14 09:48:30 2016 +0100
Fixed processing of multiline comments in WATO audit log
---
web/htdocs/wato.py | 2 +-
web/htdocs/watolib.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index cf42c3d..3061c5e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4450,7 +4450,7 @@ class ModeAuditLog(WatoMode):
table.cell(_("User"), html.attrencode(user),
css="nobreak")
# This must not be attrencoded: The entries are encoded when writing to the
log.
- table.cell(_("Change"), text, css="fill")
+ table.cell(_("Change"), text.replace("\\n",
"<br>\n"), css="fill")
table.end()
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index d4d77e1..f12a878 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -175,7 +175,7 @@ def log_entry(linkinfo, action, message, user_id=None):
make_nagios_directory(os.path.dirname(audit_log_path))
with create_user_file(audit_log_path, "ab") as f:
f.write("%d %s %s %s %s\n" % (int(time.time()), link, user_id,
- action, message))
+ action, message.replace("\n",
"\\n")))
def log_audit(linkinfo, action, message, user_id = None):