Commit 445163c5 authored by Nicolas Delaby's avatar Nicolas Delaby

asSafeHTML is not an option, it will be used in everywhere.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34039 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95e1aa9c
......@@ -1178,25 +1178,6 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, S
mime, html = self.convert(**kw)
return self._stripHTML(str(html))
security.declareProtected(Permissions.View, 'asSafeHTML')
def asSafeHTML(self, **kw):
"""
Converts the current document to HTML, strip it and remove
emmbed javascript, forms, any external plugins imports.
"""
format = 'text/x-html-safe'
if not self.hasBaseData():
return ''
try:
mime, data = self.getConversion(format=format)
return data
except KeyError:
kw['format'] = 'html'
mime, html = self.convert(**kw)
safe_html = self._safeHTML(str(html), format=format)
self.setConversion(safe_html, mime=mime, format=format)
return safe_html
def _guessEncoding(self, string):
"""
Try to guess the encoding for this string.
......
......@@ -54,13 +54,3 @@ class IHtmlConvertable(Interface):
kw -- optional parameters which can be passed to the
conversion engine
"""
def asSafeHTML(**kw):
"""
Converts the current document to HTML, and remove
emmbed javascript, forms, any external plugins imports.
kw -- optional parameters which can be passed to the
conversion engine
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment