From bb6fe4495a4e3c8d6e15d529d19330d42310c5d6 Mon Sep 17 00:00:00 2001 From: Mazen Touati <14861869+mazentouati@users.noreply.github.com> Date: Tue, 30 Jul 2019 19:24:23 +0100 Subject: [PATCH] Escape HTML in the notifications view (#3243) --- app/views/notifications/_aggregated_reactions.html.erb | 2 +- app/views/notifications/_article.html.erb | 2 +- app/views/notifications/_comment.html.erb | 6 +++--- app/views/notifications/_milestone.html.erb | 2 +- app/views/notifications/_tagadjustment.html.erb | 2 +- spec/requests/notifications_spec.rb | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/notifications/_aggregated_reactions.html.erb b/app/views/notifications/_aggregated_reactions.html.erb index 856886874..88eab5c74 100644 --- a/app/views/notifications/_aggregated_reactions.html.erb +++ b/app/views/notifications/_aggregated_reactions.html.erb @@ -22,7 +22,7 @@ reacted to " class="notification-comment-reacted-link"> <%# your article/comment or the actual title of the article/comment %> - <%= reactable_data["title"].blank? ? "your #{reactable_data['class']['name'].downcase}" : sanitize(reactable_data["title"]) %> + <%= reactable_data["title"].blank? ? "your #{reactable_data['class']['name'].downcase}" : h(reactable_data["title"]) %> with diff --git a/app/views/notifications/_article.html.erb b/app/views/notifications/_article.html.erb index f530adabc..c1ee79e68 100644 --- a/app/views/notifications/_article.html.erb +++ b/app/views/notifications/_article.html.erb @@ -40,7 +40,7 @@ ">
- <%= sanitize(json_data["article"]["title"]) %> + <%= h(json_data["article"]["title"]) %>