email templates: Mozaik removes images #4606

Open
opened 2026-02-20 16:20:29 -05:00 by deekerman · 6 comments
Owner

Originally created by @splendidinternet on GitHub (Aug 26, 2021).

Issue

I'm editing email attachments with Mozaik editor. I insert an image. I've tried both the image inserting button with upload and the direct HTML-Code with a linked image. The image is inserted and shown until saving.

Expected Behavior

The image should be shown after saving the email template.

Actual Behavior

The image is removed from the HTML. The HTML looks like this:

<img src="" alt="">

Possible Fix

Steps to Reproduce

  1. Go to "Email Templates"
  2. Edit an email template with Mozaik editor
  3. Insert an image to the email template
  4. Save the email template

Context

Your Environment

  • SuiteCRM Version used: 7.11.21
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 90.0.2 (64-Bit)
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.4.22
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 20.04
Originally created by @splendidinternet on GitHub (Aug 26, 2021). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> I'm editing email attachments with Mozaik editor. I insert an image. I've tried both the image inserting button with upload and the direct HTML-Code with a linked image. The image is inserted and shown until saving. #### Expected Behavior <!--- Tell us what should happen --> The image should be shown after saving the email template. #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> The image is removed from the HTML. The HTML looks like this: ```html <img src="" alt=""> ``` #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Go to "Email Templates" 2. Edit an email template with Mozaik editor 3. Insert an image to the email template 4. Save the email template #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.11.21 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 90.0.2 (64-Bit) * Environment name and version (e.g. MySQL, PHP 7): PHP 7.4.22 * Operating System and version (e.g Ubuntu 16.04): Ubuntu 20.04
Author
Owner

@tsmgeek commented on GitHub (Aug 26, 2021):

Seems very similar to my issue with AntiXSS being overzealous is stripping out "bad" stuff.

https://github.com/salesagility/SuiteCRM/issues/9240
https://github.com/salesagility/SuiteCRM/issues/9248

Can you check those tickets and see if it will resolve your issue.

@tsmgeek commented on GitHub (Aug 26, 2021): Seems very similar to my issue with AntiXSS being overzealous is stripping out "bad" stuff. https://github.com/salesagility/SuiteCRM/issues/9240 https://github.com/salesagility/SuiteCRM/issues/9248 Can you check those tickets and see if it will resolve your issue.
Author
Owner

@splendidinternet commented on GitHub (Aug 27, 2021):

@tsmgeek Yes, the update of the AntiXSS has fixed the bug. I've created a pull request.

@splendidinternet commented on GitHub (Aug 27, 2021): @tsmgeek Yes, the update of the AntiXSS has fixed the bug. I've created a pull request.
Author
Owner

@tsmgeek commented on GitHub (Aug 27, 2021):

Great, thanks for confirming.

@tsmgeek commented on GitHub (Aug 27, 2021): Great, thanks for confirming.
Author
Owner

@timo-ecm2 commented on GitHub (Sep 8, 2021):

I have the same issue ( v7.11.21) with the TinyMCE editor. Instead of a picture I get this;

< src="https:/Specific-url-SuiteCRM-instance.nl/uploads/o_1ff25622h17jueoe1ecmfhj1a8p8.jpg" alt="" />

The results are the same after working with the option; Editor - Direct HTML.
I receive an e-mail with the result below, again no picture.

< src="https:/Specific-url-SuiteCRM-instance.nl/uploads/o_1ff25622h17jueoe1ecmfhj1a8p8.jpg" alt="" />

Great to see that "Update AntiXSS library" is a solution for this.

@timo-ecm2 commented on GitHub (Sep 8, 2021): I have the same issue ( v7.11.21) with the TinyMCE editor. Instead of a picture I get this; < src="https:/Specific-url-SuiteCRM-instance.nl/uploads/o_1ff25622h17jueoe1ecmfhj1a8p8.jpg" alt="" /> The results are the same after working with the option; Editor - Direct HTML. I receive an e-mail with the result below, again no picture. < src="https:/Specific-url-SuiteCRM-instance.nl/uploads/o_1ff25622h17jueoe1ecmfhj1a8p8.jpg" alt="" /> Great to see that "Update AntiXSS library" is a solution for this.
Author
Owner

@SuiteBot commented on GitHub (Apr 14, 2022):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/version-7-12-2-email-template-builder-images-disapear/84640/2

@SuiteBot commented on GitHub (Apr 14, 2022): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/version-7-12-2-email-template-builder-images-disapear/84640/2
Author
Owner

@SuiteBot commented on GitHub (Apr 20, 2022):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/email-template-issues/84627/5

@SuiteBot commented on GitHub (Apr 20, 2022): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/email-template-issues/84627/5
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4606
No description provided.