Commit 298bd7a7 authored by Nicolas Delaby's avatar Nicolas Delaby

Store in cache only safe HTML content


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34367 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8683bcd
......@@ -511,7 +511,13 @@ class OOoDocument(PermanentURLMixIn, File, CachedConvertableMixin):
self.manage_delObjects([file_name]) # For compatibility with old implementation
if file_name.endswith('html'):
mime = 'text/html'
data = zip_file.read(file_name)
# call portal_transforms to strip HTML in safe mode
portal = self.getPortalObject()
transform_tool = getToolByName(portal, 'portal_transforms')
data = transform_tool.convertToData('text/xhtml-safe',
zip_file.read(file_name),
object=self, context=self,
mimetype=mime)
else:
mime = guess_content_type(file_name)[0]
data = Pdata(zip_file.read(file_name))
......
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