From 24206de0d01095a8a92851411d64fc74af23e33b Mon Sep 17 00:00:00 2001 From: Saif Ur Rehman Date: Wed, 11 Oct 2023 13:17:27 +0500 Subject: [PATCH] fix(Email Inline Embed): Unescape embed path (#22291) --- frappe/email/email_body.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/email/email_body.py b/frappe/email/email_body.py index c4194b2e0e..268de161b3 100755 --- a/frappe/email/email_body.py +++ b/frappe/email/email_body.py @@ -509,9 +509,10 @@ def replace_filename_with_cid(message): # found match img_path = groups[0] - filename = img_path.rsplit("/")[-1] + img_path_escaped = frappe.utils.html_utils.unescape_html(img_path) + filename = img_path_escaped.rsplit("/")[-1] - filecontent = get_filecontent_from_path(img_path) + filecontent = get_filecontent_from_path(img_path_escaped) if not filecontent: message = re.sub(f"""embed=['"]{re.escape(img_path)}['"]""", "", message) continue