From d3080eb113ecc572de46426aeacdd3bb1f92f516 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Fri, 5 Oct 2018 16:06:05 +0200 Subject: [PATCH] use safe_nativestring to transform before html.fromstring --- Products/PortalTransforms/transforms/safe_html.py | 7 +++---- news/38.bugfix | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 news/38.bugfix diff --git a/Products/PortalTransforms/transforms/safe_html.py b/Products/PortalTransforms/transforms/safe_html.py index d9d7884..807ee74 100644 --- a/Products/PortalTransforms/transforms/safe_html.py +++ b/Products/PortalTransforms/transforms/safe_html.py @@ -3,6 +3,7 @@ import six from Products.CMFPlone.interfaces import IFilterSchema +from Products.CMFPlone.utils import safe_encode from Products.PortalTransforms.interfaces import ITransform from Products.PortalTransforms.libtransforms.utils import bodyfinder from lxml import etree @@ -2398,10 +2399,8 @@ def convert(self, orig, data, **kwargs): def scrub_html(self, orig): # append html tag to create a dummy parent for the tree html_parser = html.HTMLParser(encoding='utf-8') - if isinstance(orig, six.binary_type): - tag = b'