From fc9b8de922e7ead161f353b01125e937d89eed03 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Mon, 29 Oct 2018 16:18:03 +0800 Subject: [PATCH] Ignore in forward-email text field (fixes #2305) --- app/assets/javascripts/app/lib/app_post/utils.coffee | 2 +- public/assets/tests/html_utils.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index 8eb83c257..44ae9459d 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -1146,7 +1146,7 @@ class App.Utils html.find('img').each( (index) -> src = $(@).attr('src') - if !src.match(/^data:/i) + if !src.match(/^(data|cid):/i) # may mean broken emails (see issue #2305) base64 = App.Utils._htmlImage2DataUrl(@) $(@).attr('src', base64) ) diff --git a/public/assets/tests/html_utils.js b/public/assets/tests/html_utils.js index e7ecd85eb..a9826538d 100644 --- a/public/assets/tests/html_utils.js +++ b/public/assets/tests/html_utils.js @@ -3079,6 +3079,11 @@ test("htmlImage2DataUrl", function() { result = App.Utils.htmlImage2DataUrl(source) equal(result, should, source) + source = 'some test' + should = 'some test' + result = App.Utils.htmlImage2DataUrl(source) + equal(result, should, source) + }); source = 'some test'