Module: check_mk
Branch: master
Commit: a46bff6c9123e0546c5c6520ca37c8bd0c5fa9ad
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a46bff6c9123e0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 4 17:03:46 2016 +0200
3567 FIX Werk list: Fixed link to not existing check man pages in some cases
---
.werks/3567 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/werks.py | 7 ++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/3567 b/.werks/3567
new file mode 100644
index 0000000..d941e23
--- /dev/null
+++ b/.werks/3567
@@ -0,0 +1,10 @@
+Title: Werk list: Fixed link to not existing check man pages in some cases
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462374161
+
+
diff --git a/ChangeLog b/ChangeLog
index e933f4a..08ef33a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -276,6 +276,7 @@
* 3454 FIX: Fixed scaling of numbers in graphs (e.g. inodes of filesystems)
* 3462 FIX: Fixed ineffective localizations on werk page after language change
* 3468 FIX: Fix changing a user's language back to English if the default is
German...
+ * 3567 FIX: Werk list: Fixed link to not existing check man pages in some cases
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py
index b70e53d..31ff1f0 100644
--- a/web/htdocs/werks.py
+++ b/web/htdocs/werks.py
@@ -28,6 +28,7 @@
# log
import defaults, config, os, table
+import re
from lib import *
from valuespec import *
@@ -587,10 +588,10 @@ def render_werk_description(werk):
def insert_manpage_links(text):
parts = text.replace(",", " ").split()
new_parts = []
+ check_regex = re.compile("[-_\.a-z0-9]")
for part in parts:
- if os.path.exists(defaults.check_manpages_dir + "/" + part):
- part = '<a
href="wato.py?mode=check_manpage&check_type=%s">%s</a>' % (
- part, part)
+ if check_regex.match(part) and os.path.exists(defaults.check_manpages_dir +
"/" + part):
+ part = '<a
href="wato.py?mode=check_manpage&check_type=%s">%s</a>' %
(part, part)
new_parts.append(part)
return " ".join(new_parts)