Don't show broken images in digest and missed PMs emails.

(imported from commit 92297b4c8f020e30b5c00e93bf32df6e19069dd8)
This commit is contained in:
Jessica McKellar 2013-12-18 13:51:11 -05:00
parent 96ea91056e
commit 0d7ea7353f
1 changed files with 6 additions and 0 deletions

View File

@ -1897,6 +1897,12 @@ def build_message_list(user_profile, messages):
content = re.sub(
r"/user_uploads/(\S*)",
settings.EXTERNAL_HOST + r"/user_uploads/\1", content)
# Our proxying user-uploaded images seems to break inline images in HTML
# emails, so scrub the image but leave the link.
content = re.sub(
r"<img src=(\S+)/user_uploads/(\S+)>", "", content)
# URLs for emoji are of the form
# "static/third/gemoji/images/emoji/snowflake.png".
content = re.sub(