properly escape site-title stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Sep 2009 14:17:39 +0200
branchstable
changeset 3166 2413e5291e8d
parent 3164 b025592ff478
child 3169 3a1cf3598726
properly escape site-title
web/views/basecomponents.py
web/views/basetemplates.py
--- a/web/views/basecomponents.py	Thu Sep 10 12:23:16 2009 +0200
+++ b/web/views/basecomponents.py	Thu Sep 10 14:17:39 2009 +0200
@@ -148,7 +148,7 @@
         title = self.req.property_value('ui.site-title')
         if title:
             self.w(u'<span id="appliName"><a href="%s">%s</a></span>' % (
-                self.req.base_url(), title))
+                self.req.base_url(), xml_escape(title)))
 
 
 class SeeAlsoVComponent(component.RelatedObjectsVComponent):
--- a/web/views/basetemplates.py	Thu Sep 10 12:23:16 2009 +0200
+++ b/web/views/basetemplates.py	Thu Sep 10 14:17:39 2009 +0200
@@ -441,8 +441,12 @@
         self.req.add_css('cubicweb.login.css')
         self.w(u'<div id="%s" class="%s">' % (id, klass))
         if title:
-            self.w(u'<div id="loginTitle">%s</div>'
-                   % (self.req.property_value('ui.site-title') or u'&#160;'))
+            stitle = self.req.property_value('ui.site-title')
+            if stitle:
+                stitle = xml_escape(stitle)
+            else:
+                stitle = u'&#160;'
+            self.w(u'<div id="loginTitle">%s</div>' % stitle)
         self.w(u'<div id="loginContent">\n')
 
         if message: