Module: check_mk
Branch: master
Commit: d2997de7a24ff7b9c45df28182ea082868a978b5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d2997de7a24ff7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 11 12:49:41 2017 +0200
Fixed link of empty virtual folder tree snapin
Change-Id: I4737ed29a1c1e7923199522685f2086be59e6675
---
web/htdocs/htmllib.py | 6 ++++--
web/plugins/sidebar/shipped.py | 6 +++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 2d35c6f..55a9987 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -111,8 +111,9 @@ class RequestTimeout(MKException):
class Escaper(object):
def __init__(self):
super(Escaper, self).__init__()
- self._unescaper_text = re.compile(r'<(/?)(h1|h2|b|tt|i|u|br(?:
/)?|nobr(?: /)?|pre|a|sup|p|li|ul|ol)>')
- self._unescaper_href = re.compile(r'<a
href=(?:"|\')(.*?)(?:"|\')>')
+ self._unescaper_text = re.compile(r'<(/?)(h1|h2|b|tt|i|u|br(?:
/)?|nobr(?: /)?|pre|a|sup|p|li|ul|ol)>')
+ self._unescaper_href = re.compile(r'<a
href=(?:"|\')(.*?)(?:"|\')>')
+ self._unescaper_href_target = re.compile(r'<a
href=(?:"|\')(.*?)(?:"|\')
target=(?:"|\')(.*?)(?:"|\')>')
# Encode HTML attributes. Replace HTML syntax with HTML text.
@@ -149,6 +150,7 @@ class Escaper(object):
text = self.escape_attribute(text)
text = self._unescaper_text.sub(r'<\1\2>', text)
# Also repair link definitions
+ text = self._unescaper_href_target.sub(r'<a href="\1"
target="\2">', text)
text = self._unescaper_href.sub(r'<a href="\1">', text)
text = re.sub(r'&nbsp;', ' ', text)
return text
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 7c6d636..9a281fa 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1883,9 +1883,9 @@ class VirtualHostTree(SidebarSnapin):
self._load()
if not config.virtual_host_trees:
url = 'wato.py?varname=virtual_host_trees&mode=edit_configvar'
- multisite = html.render_a("Multisite", href=url,
target="main")
- html.p(HTML(_('You have not defined any virtual host trees. You can do
this '
- 'in the global settings for %s.') % multisite))
+ multisite_link = html.render_a(_("global settings"), href=url,
target="main")
+ html.p(_('You have not defined any virtual host trees. You can do this
'
+ 'in the %s.') % multisite_link)
return
self._show_tree_selection()