[IMP] tools: remove unnecessary lxml Cleaner override

Purpose
=======

Currently a custom override of Cleaner.allow_element()
exists in tools to allow object tags for SVG images.
This was due to the first prototype of website builder
and its first implementation of image and svg management.

This is not necessary anymore as using the tag is sufficient.
We can safely clean code in the cleaner, allowing to speedup
its performances. As it is used in most html fields and email
parsing each unnecessary code removed is time gainged.

Task 2215228

closes odoo/odoo#51294

X-original-commit: 4a0b09fd3b0d3b63f2df00f002e4d6825cac4eef
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Stéphane Debauche
2020-05-14 18:51:22 +00:00
committed by Thibault Delavallée
parent c54824dfee
commit 55cb0de1db
-5
View File
@@ -161,11 +161,6 @@ class _Cleaner(clean.Cleaner):
else:
del el.attrib['style']
def allow_element(self, el):
if el.tag == 'object' and el.get('type') == "image/svg+xml":
return True
return super(_Cleaner, self).allow_element(el)
def html_sanitize(src, silent=True, sanitize_tags=True, sanitize_attributes=False, sanitize_style=False, sanitize_form=True, strip_style=False, strip_classes=False):
if not src: