Module: check_mk
Branch: master
Commit: 7b7a7da9af8bb4807081403c05737d59ae4df774
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b7a7da9af8bb4…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Jul 16 09:07:03 2018 +0200
6209 FIX utils.py: Fix display of state markers after URLs
Properly display URLs in service description if they are
followed by a state marker, as in
"... url:
http://localhost/heute/check_mk/deploy_agent.py<b class..."
Change-Id: If0b5efeb3ab07e43d771451d70719821a1ae7e9e
---
.werks/6209 | 11 +++++++++++
cmk/gui/utils.py | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/6209 b/.werks/6209
new file mode 100644
index 0000000..b96e558
--- /dev/null
+++ b/.werks/6209
@@ -0,0 +1,11 @@
+Title: utils.py: Fix display of state markers after URLs
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1531725353
+Class: fix
+
+Properly display URLs in service description if they are
+followed by a state marker.
diff --git a/cmk/gui/utils.py b/cmk/gui/utils.py
index 5442121..c5c0674 100644
--- a/cmk/gui/utils.py
+++ b/cmk/gui/utils.py
@@ -188,9 +188,10 @@ def format_plugin_output(output, row=None, shall_escape=True):
output = output[:a] + "running on " + h + output[e+1:]
if shall_escape:
+ http_url =
r"(http[s]?://[A-Za-z0-9\-._~:/?#\[\]@!$&'()*+,;=%]+)"
# (?:<A HREF="), (?: target="_blank">)?
and endswith(" </A>") is a special
# handling for the HTML code produced by check_http when "clickable
URL" option is active.
- output = re.sub("(?:<A
HREF=")?(http[s]?://[^\"'>\\s,]+)(?:
target="_blank">)?",
+ output = re.sub("(?:<A HREF=")?" + http_url + "(?:
target="_blank">)?",
lambda p: '<a href="%s"><img
class=pluginurl align=absmiddle title="%s"
src="images/pluginurl.png"></a>' %
(p.group(1).replace('"', ''),
p.group(1).replace('"', '')), output)