Module: check_mk
Branch: master
Commit: 7d5ce689b2b75d29812fa4d6e1ae15765e4481c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d5ce689b2b75d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 10 13:41:58 2015 +0100
Fix: Handling HTML codes in various error messages correctly
---
web/htdocs/htmllib.py | 2 +-
web/htdocs/wato.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index f92cf9d..689519d 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1002,7 +1002,7 @@ class html:
# <b>, <tt>, <i> to be part of the exception message. The tags
# are escaped first and then fixed again after attrencode.
msg = self.attrencode(obj)
- msg = re.sub(r'<(/?)(b|tt|i|br|pre|a|sup|p)>',
r'<\1\2>', msg)
+ msg = re.sub(r'<(/?)(b|tt|i|br|pre|a|sup|p|li|ul|ol)>',
r'<\1\2>', msg)
# Also repair link definitions
msg = re.sub(r'<a href="(.*)">',
r'<a href="\1">', msg)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 7fd30f4..41556b7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5364,10 +5364,10 @@ def check_mk_local_automation(command, args=[],
indata=""):
sudoline = "%s ALL = (root) NOPASSWD: %s *" %
(html.apache_user(), commandargs[0], " ".join(commandargs[1:]))
sudo_msg = ("<p>The webserver is running as user which has no rights
on the "
- "needed Check_MK/Nagios files.<br />Please ensure you have
set-up "
+ "needed Check_MK/Nagios files.<br>Please ensure you have
set-up "
"the sudo environment correctly. e.g. proceed as
follows:</p>\n"
"<ol><li>install sudo package</li>\n"
- "<li>Append the following to the
<code>/etc/sudoers</code> file:\n"
+ "<li>Append the following to the
<tt>/etc/sudoers</tt> file:\n"
"<pre># Needed for WATO - the Check_MK Web Administration
Tool\n"
"Defaults:%s !requiretty\n"
"%s\n"
@@ -5393,7 +5393,7 @@ def check_mk_local_automation(command, args=[],
indata=""):
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True)
except Exception, e:
if commandargs[0] == 'sudo':
- raise MKGeneralException("Cannot execute <tt>%s</tt>:
%s<br /><br >%s" % (commandargs[0], e, sudo_msg))
+ raise MKGeneralException("Cannot execute <tt>%s</tt>:
%s<br><br>%s" % (commandargs[0], e, sudo_msg))
else:
raise MKGeneralException("Cannot execute <tt>%s</tt>:
%s" % (commandargs[0], e))
p.stdin.write(repr(indata))