Module: check_mk
Branch: master
Commit: 19c70f775c80b15abe83f6fac4837732d34fd02f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19c70f775c80b1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 29 14:20:35 2015 +0200
#2379 FIX Plugin-Output: Fixed handling of URLs within output of check_http
By default the plugin outputs are searched for URLs which are then replaced
by a "world" icon which links to this URL. This find/replace pattern was
not working correctly with the URLs provided by the check_http plugin which
surrounds the URLs with <tt>'</tt> characters.
---
.werks/2379 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/lib.py | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/2379 b/.werks/2379
new file mode 100644
index 0000000..a8a5898
--- /dev/null
+++ b/.werks/2379
@@ -0,0 +1,13 @@
+Title: Plugin-Output: Fixed handling of URLs within output of check_http
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435580314
+
+By default the plugin outputs are searched for URLs which are then replaced
+by a "world" icon which links to this URL. This find/replace pattern was
+not working correctly with the URLs provided by the check_http plugin which
+surrounds the URLs with <tt>'</tt> characters.
diff --git a/ChangeLog b/ChangeLog
index 72323a2..89157a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
Multisite:
* 2314 FIX: Availability: fixed exception when grouping by host or service group
* 2361 FIX: Fix exception for missing key 'title' in certain cases of older
customized views
+ * 2379 FIX: Plugin-Output: Fixed handling of URLs within output of check_http...
WATO:
* 2344 FIX: Improved validation of selected rules when editing BI aggregations...
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 6e49dfa..6893990 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -341,7 +341,7 @@ def format_plugin_output(output, row = None):
output = output[:a] + "running on " + h + output[e+1:]
if config.escape_plugin_output:
- output =
re.sub("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
+ output = re.sub("http[s]?://[^\"'>\t\s\n]+",
lambda p: '<a href="%s"><img
class=pluginurl align=absmiddle title="%s"
src="images/pluginurl.png"></a>' %
(p.group(0).replace('"', ''),
p.group(0).replace('"', '')), output)