Skip to content
Snippets Groups Projects
Commit d952e011 authored by Antoine Guenet's avatar Antoine Guenet
Browse files

[FIX] mail: replace local url of background image with single quotes


Relative image urls have to be replaced with absolute urls in order to
be able to display them in the email. This failed to be done for urls in
styles attributes if they were enclosed in (unicode decimal) single
quotes.

opw-3452655

closes odoo/odoo#132240

Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
parent 9034602a
No related branches found
No related tags found
No related merge requests found
......@@ -153,9 +153,9 @@ class MailRenderMixin(models.AbstractModel):
r"""( # Group 1: element up to url in style
<[^>]+\bstyle=" # Element with a style attribute
[^"]+\burl\( # Style attribute contains "url(" style
(?:&\#34;|'|&quot;)?) # url style may start with (escaped) quote: capture it
(?:&\#34;|'|&quot;|&\#39;)?) # url style may start with (escaped) quote: capture it
( # Group 2: url itself
/(?:[^'")]|(?!&\#34;))+ # stop at the first closing quote
/(?:[^'")]|(?!&\#34;)|(?!&\#39;))+ # stop at the first closing quote
)""", re.VERBOSE), _sub_relative2absolute, html)
return wrapper(html)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment