Skip to content

Commit

Permalink
Escape mail body before reporting error
Browse files Browse the repository at this point in the history
see #4586
  • Loading branch information
charlag committed Sep 16, 2022
1 parent d3e88b1 commit ffd7610
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/misc/ErrorReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ export function showErrorDialogNotLoggedIn(e: ErrorInfo): Promise<void> {
export async function sendFeedbackMail(content: FeedbackContent): Promise<void> {
const name = ""
const mailAddress = "reports@tutao.de"
// We want to treat what we have as text, not as HTML so we escape it. This is an easy way to do it.
const escapedBody = new Option(content.message).innerHTML
const draft = await locator.mailFacade.createDraft(
{
subject: content.subject,
bodyText: content.message.split("\n").join("<br>"),
bodyText: escapedBody.split("\n").join("<br>"),
senderMailAddress: neverNull(logins.getUserController().userGroupInfo.mailAddress),
senderName: "",
toRecipients: [
Expand Down

0 comments on commit ffd7610

Please sign in to comment.