[Erp5-report] r36539 nicolas - /erp5/trunk/products/PortalTransforms/transforms/safe_html.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 23 15:16:24 CEST 2010


Author: nicolas
Date: Wed Jun 23 15:16:22 2010
New Revision: 36539

URL: http://svn.erp5.org?rev=36539&view=rev
Log:
Charset replacer should apply only on meta nodes.
Add condition to check that content attribute belong to meta tag
not another one.

Modified:
    erp5/trunk/products/PortalTransforms/transforms/safe_html.py

Modified: erp5/trunk/products/PortalTransforms/transforms/safe_html.py
URL: http://svn.erp5.org/erp5/trunk/products/PortalTransforms/transforms/safe_html.py?rev=36539&r1=36538&r2=36539&view=diff
==============================================================================
--- erp5/trunk/products/PortalTransforms/transforms/safe_html.py [utf8] (original)
+++ erp5/trunk/products/PortalTransforms/transforms/safe_html.py [utf8] Wed Jun 23 15:16:22 2010
@@ -185,8 +185,8 @@ class StrippingParser(HTMLParser):
                 elif remove_script and hasScript(v):
                     if not self.raise_error: continue
                     else: raise IllegalHTML, 'Script URI "%s" not allowed.' % v
-                elif k.lower() == 'content' and self.default_encoding and\
-                                                self.default_encoding not in v:
+                elif tag.lower() == 'meta' and k.lower() == 'content' and\
+                     self.default_encoding and self.default_encoding not in v:
                     match = charset_parser.search(v)
                     if match is not None:
                       self.original_charset = match.group('charset')




More information about the Erp5-report mailing list