summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2017-10-27 09:54:44 +0200
committerAdrian Torres <adt@odoo.com>2017-10-27 13:32:15 +0200
commit2f0435f08112251abce2591f44e748896c030420 (patch)
tree2cda95cca019f31224035ffd2b73a42c5f219ee6 /addons/web/static/src
parente51fa63bdaba8184559a730a76d5d50d0073a059 (diff)
[FIX] tools: bad regex in mail.py
Before this commit, if comments were found inside the body of a mail template sent through mass_mailing, the regex in append_content_to_html that converts possible uppercase tags to lowercase tags would replace comments by broken html elements, this would break the in-browser parser and thus would show partial content or no content at all, depending on the positioning of the comments. i.e. from <!-- This is a comment --> to <this --> The regex in question is r'(</?)\W*(\w+)([ >])' which basically matches opening and closing tags (this was a bad idea from the beginning btw), the \W* will match any non-alphanumeric chars (so !-- in the case of comments) and this would be completely discarded since it's not a match group and when replacing we only use match groups. This is fixed by simply stripping the \W* since it's discarded anyway, an alternative fix would be to put it in a match group and add it when replacing as well, but I don't know if we purposefully discard it or not. Neither fix is the good one, the good fix is to replace all the re.subs by lxml which is much easier and more concise.
Diffstat (limited to 'addons/web/static/src')
0 files changed, 0 insertions, 0 deletions