Correctly escape user-defined names in emails

Closes #1151

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-10-31 13:00:45 +01:00
parent 695d773d50
commit 470a3e594b
28 changed files with 162 additions and 118 deletions

View File

@@ -16,7 +16,7 @@
>
<h1 style="font-size: 48px; font-weight: 400; margin: 0;">
<%= gettext("The group %{group} has been suspended on %{instance}!",
group: @group.name || @group.preferred_username,
group: display_name(@group),
instance: @instance_name
) %>
</h1>
@@ -49,12 +49,8 @@
<p style="margin: 0;">
<%= gettext(
"Your instance's moderation team has decided to suspend <b>%{group_name}</b> (%{group_address}). You are no longer a member of this group.",
group_name: @group.name,
group_address:
if(@group.domain,
do: "@#{@group.preferred_username}@#{@group.domain}",
else: "@#{@group.preferred_username}"
)
group_name: escape_html(display_name(@group)),
group_address: preferred_username_and_domain(@group)
)
|> raw %>
</p>