Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZBUG-3629: fixed handling of image in signature #879

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

k-kato
Copy link
Contributor

@k-kato k-kato commented Jul 9, 2024

Issue:
An inline image is not included in a reply/forward message when the sender of the original message is added to trusted address.

Root cause:
Source of an image was fetched in the following priority:
dfsrc => data-mce-src => src

Before the fix, data-mce-src is set for an image in a signature.
<img pnsrc="cid:edf162835aead51e0a185735d5add806ee0b8710@zimbra" data-mce-src="https://HOST/home/ACCOUNT/Briefcase/imageg.png" src="https://HOST/service/home/~/?auth=co&amp;loc=en_US&amp;id=400&amp;part=2.2">

At reply/forward, the url in data-mce-src is set in src of img tag when a trusted address is configured.

ZmComposeView.js, line 1239:
else if (showImages) {
	var src = dfsrc;//x + "&t=" + (new Date()).getTime();
	num++;
	images[i].src = src;
	images[i].setAttribute("dfsrc", dfsrc);
}

Then the image in the forwarded message points the briefcase path. If it is not shared, the image cannot be fetched.
The full access path to a briefcase file is unnecessary for a recipient. The image file is embedded in a message source and referred as cid. The image should always be fetched from the embedded data.

Fix:

  • When a signature is set in Compose page, data-mce-src is removed from the image.
  • When a signature image is reused at reply/forward, cid in src is used if it exists.

@silentsakky silentsakky merged commit 9fc70b9 into develop Jul 16, 2024
@silentsakky silentsakky deleted the ZBUG-3629 branch July 16, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants