Skip to content
Snippets Groups Projects
Commit dbdedcedff5c authored by Sandrine Ribeau's avatar Sandrine Ribeau
Browse files

[views] use xml_escape instead of html_escape

parent 52afeac04d88
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
from itertools import count from itertools import count
from logilab.mtconverter import html_escape from logilab.mtconverter import xml_escape
from logilab.common.decorators import monkeypatch from logilab.common.decorators import monkeypatch
from simplejson import dumps from simplejson import dumps
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
from cubicweb.web.action import LinkToEntityAction, Action from cubicweb.web.action import LinkToEntityAction, Action
from cubicweb.web.form import FormViewMixIn from cubicweb.web.form import FormViewMixIn
from cubicweb.web.formwidgets import Button from cubicweb.web.formwidgets import Button
from cubicweb.web.views import primary, baseviews from cubicweb.web.views import primary, baseviews, xmlrss
from cubicweb.web.component import EntityVComponent from cubicweb.web.component import EntityVComponent
from cubicweb.web.views.basecontrollers import JSonController from cubicweb.web.views.basecontrollers import JSonController
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
entity = self.entity(row, col) entity = self.entity(row, col)
root = entity.root() root = entity.root()
self.w(u'[<a href="%s">#%s</a>] ' self.w(u'[<a href="%s">#%s</a>] '
% (html_escape(root.absolute_url()), root.eid)) % (xml_escape(root.absolute_url()), root.eid))
maxsize = self.req.property_value('navigation.short-line-size') maxsize = self.req.property_value('navigation.short-line-size')
maxsize = maxsize - len(str(root.eid)) maxsize = maxsize - len(str(root.eid))
content = entity.printable_value('content', format='text/plain') content = entity.printable_value('content', format='text/plain')
...@@ -92,5 +92,5 @@ ...@@ -92,5 +92,5 @@
maxsize = self.req.property_value('navigation.short-line-size') maxsize = self.req.property_value('navigation.short-line-size')
maxsize = maxsize - len(str(root.eid)) maxsize = maxsize - len(str(root.eid))
content = entity.printable_value('content', format='text/plain') content = entity.printable_value('content', format='text/plain')
content = html_escape(cut(content, maxsize)) content = xml_escape(cut(content, maxsize))
self.w(u'<a href="%s">#%s <i>%s</i></a>\n' % ( self.w(u'<a href="%s">#%s <i>%s</i></a>\n' % (
...@@ -96,5 +96,5 @@ ...@@ -96,5 +96,5 @@
self.w(u'<a href="%s">#%s <i>%s</i></a>\n' % ( self.w(u'<a href="%s">#%s <i>%s</i></a>\n' % (
html_escape(entity.absolute_url()), entity.eid, content)) xml_escape(entity.absolute_url()), entity.eid, content))
class CommentTreeItemView(baseviews.ListItemView): class CommentTreeItemView(baseviews.ListItemView):
...@@ -118,11 +118,11 @@ ...@@ -118,11 +118,11 @@
'comment%sHolder' % entity.eid, rql_for_eid(entity.eid), 'comment%sHolder' % entity.eid, rql_for_eid(entity.eid),
'inlinecomment') 'inlinecomment')
reply = ' | %s <a href="%s"> %s </a>' % ( _login_register_link(self), reply = ' | %s <a href="%s"> %s </a>' % ( _login_register_link(self),
html_escape(url), xml_escape(url),
_(action.title)) _(action.title))
if editaction is None: if editaction is None:
edit = u'' edit = u''
else: else:
url = self.req.build_ajax_replace_url( url = self.req.build_ajax_replace_url(
'comment%s' % entity.eid, rql_for_eid(entity.eid), 'comment%s' % entity.eid, rql_for_eid(entity.eid),
'editcomment') 'editcomment')
...@@ -123,10 +123,10 @@ ...@@ -123,10 +123,10 @@
if editaction is None: if editaction is None:
edit = u'' edit = u''
else: else:
url = self.req.build_ajax_replace_url( url = self.req.build_ajax_replace_url(
'comment%s' % entity.eid, rql_for_eid(entity.eid), 'comment%s' % entity.eid, rql_for_eid(entity.eid),
'editcomment') 'editcomment')
edit = ' | <a href="%s">%s</a>' % (html_escape(url), edit = ' | <a href="%s">%s</a>' % (xml_escape(url),
_(editaction.title)) _(editaction.title))
text = entity.printable_value('content') text = entity.printable_value('content')
if not kwargs.get('full'): if not kwargs.get('full'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment