fix(Email Inline Embed): Unescape embed path (#22291)

This commit is contained in:
Saif Ur Rehman 2023-10-11 13:17:27 +05:00 committed by GitHub
parent 7165f94148
commit 24206de0d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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