From 1ae0b4f47a8a14d936c683799080cdf4a88656ed Mon Sep 17 00:00:00 2001 From: Anna Buianova Date: Wed, 16 Dec 2020 10:02:19 +0300 Subject: [PATCH] Use helpers.tag and safe_join instead of html_safe (#11916) --- app/controllers/admin/users_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index f4271ab28..bb059ff0e 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -76,14 +76,12 @@ module Admin @user = User.find(params[:id]) begin Moderator::DeleteUser.call(user: @user) - link = helpers.link_to("the page", admin_users_gdpr_delete_requests_path, "data-no-instant" => true) - # rubocop:disable Rails/OutputSafety + link = helpers.tag.a("the page", href: admin_users_gdpr_delete_requests_path, data: { "no-instant" => true }) message = "@#{@user.username} (email: #{@user.email.presence || 'no email'}, user_id: #{@user.id}) " \ "has been fully deleted. " \ "If this is a GDPR delete, delete them from Mailchimp & Google Analytics " \ - " and confirm on #{link}.".html_safe - # rubocop:enable Rails/OutputSafety - flash[:success] = message + " and confirm on " + flash[:success] = helpers.safe_join([message, link, "."]) rescue StandardError => e flash[:danger] = e.message end