diff options
| author | Stéphane Debauche <std@odoo.com> | 2020-05-14 15:25:13 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-05-14 18:51:22 +0000 |
| commit | 55cb0de1dbbce55297d167335b76f0654124efb8 (patch) | |
| tree | 8138a82c24d9afe3f2ef3d3f2033eeb577a8af62 | |
| parent | c54824dfee24c08c62d1e8a60f09710e40b675cc (diff) | |
[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>
| -rw-r--r-- | odoo/tools/mail.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py index 1a3e9d80b9f..fd40244500c 100644 --- a/odoo/tools/mail.py +++ b/odoo/tools/mail.py @@ -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: |
