Skip to content

Commit

Permalink
SAK-41717 filter the user-supplied HTML because an emoji will cause a…
Browse files Browse the repository at this point in the history
… stacktrace and fail to distribute the email (sakaiproject#6846)
  • Loading branch information
ottenhoff authored Apr 30, 2019
1 parent c0ed84f commit 05c9c5f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,13 @@ public MailArchiveMessageEdit addMailArchiveMessage() throws PermissionException
public MailArchiveMessage addMailArchiveMessage(String subject, String fromAddress, Instant dateSent, List mailHeaders,
List attachments, String[] body) throws PermissionException
{
StringBuilder alertMsg = new StringBuilder();
String cleanedHtml = FormattedText.processFormattedText(body[1], alertMsg);

MailArchiveMessageEdit edit = (MailArchiveMessageEdit) addMessage();
MailArchiveMessageHeaderEdit archiveHeaders = edit.getMailArchiveHeaderEdit();
edit.setBody(body[0]);
edit.setHtmlBody(body[1]);
edit.setHtmlBody(cleanedHtml);
archiveHeaders.replaceAttachments(attachments);
archiveHeaders.setSubject(subject);
archiveHeaders.setFromAddress(fromAddress);
Expand Down

0 comments on commit 05c9c5f

Please sign in to comment.