[Erp5-report] r34367 nicolas - /erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 8 11:33:38 CEST 2010
Author: nicolas
Date: Thu Apr 8 11:33:36 2010
New Revision: 34367
URL: http://svn.erp5.org?rev=34367&view=rev
Log:
Store in cache only safe HTML content
Modified:
erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
Modified: erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/Document/OOoDocument.py?rev=34367&r1=34366&r2=34367&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] Thu Apr 8 11:33:36 2010
@@ -511,7 +511,13 @@
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))
More information about the Erp5-report
mailing list