From a8ce11a4d29bd0bbede16ebdf7785716d7fc7e32 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Tue, 5 Mar 2019 18:16:13 +0100 Subject: [PATCH] Add rel=noopener to links with target=_blank http://support.detectify.com/customer/portal/articles/2792257-external-links-using-target-_blank- --- app/controllers/webhook_controller.rb | 2 +- app/helpers/string_to_html_helper.rb | 4 +-- .../administrateur/DraggableItem.vue | 2 +- .../admin/procedures/_informations.html.haml | 8 +++--- .../procedures/new_from_existing.html.haml | 2 +- app/views/admin/procedures/show.html.haml | 4 +-- .../admin/types_de_champ/_fields.html.haml | 2 +- app/views/demandes/new.html.haml | 2 +- .../notify_new_answer.html.haml | 2 +- .../dossier_mailer/notify_new_draft.html.haml | 2 +- .../procedure_link_field/_show.html.haml | 2 +- app/views/layouts/_navbar.html.haml | 2 +- .../_outdated_browser_banner.html.haml | 2 +- ...dmin_procedurescontroller_navbar.html.haml | 2 +- .../layouts/mailers/notification.html.haml | 2 +- .../new_administrateur/_breadcrumbs.html.haml | 2 +- .../services/_form.html.haml | 2 +- .../dossiers/_header.html.haml | 2 +- .../dossiers/_state_button.html.haml | 2 +- .../_state_button_motivation.html.haml | 2 +- .../procedures/_download_dossiers.html.haml | 6 ++-- .../dossiers/show/_status_overview.html.haml | 2 +- app/views/root/_footer.html.haml | 2 +- app/views/root/accessibilite.html.haml | 6 ++-- app/views/root/suivi.html.haml | 4 +-- app/views/root/tour_de_france.html.haml | 28 +++++++++---------- .../champs/dossier_link/_show.html.haml | 2 +- .../piece_justificative/_pj_link.html.haml | 2 +- .../champs/siret/_etablissement.html.haml | 2 +- app/views/shared/dossiers/_edit.html.haml | 6 ++-- .../shared/dossiers/_pieces_jointes.html.haml | 4 +-- .../_piece_justificative.html.haml | 2 +- .../dossiers/messages/_message.html.haml | 4 +-- app/views/users/registrations/new.html.haml | 2 +- app/views/users/sessions/link_sent.html.haml | 2 +- app/views/users/sessions/new.html.haml | 2 +- public/500.html | 2 +- spec/helpers/string_to_html_helper_spec.rb | 2 +- 38 files changed, 65 insertions(+), 65 deletions(-) diff --git a/app/controllers/webhook_controller.rb b/app/controllers/webhook_controller.rb index cdce598a5..8ee719820 100644 --- a/app/controllers/webhook_controller.rb +++ b/app/controllers/webhook_controller.rb @@ -33,7 +33,7 @@ class WebhookController < ActionController::Base private def link_to_manager(model, url) - "#{model.model_name.human}##{model.id}" + "#{model.model_name.human}##{model.id}" end def verify_signature! diff --git a/app/helpers/string_to_html_helper.rb b/app/helpers/string_to_html_helper.rb index 2e01ab99b..76a595699 100644 --- a/app/helpers/string_to_html_helper.rb +++ b/app/helpers/string_to_html_helper.rb @@ -1,7 +1,7 @@ module StringToHtmlHelper def string_to_html(str) html_formatted = simple_format(str) - with_links = html_formatted.gsub(URI.regexp, '\0') - sanitize(with_links, attributes: ['href', 'target']) + with_links = html_formatted.gsub(URI.regexp, '\0') + sanitize(with_links, attributes: ['target', 'rel', 'href']) end end diff --git a/app/javascript/new_design/administrateur/DraggableItem.vue b/app/javascript/new_design/administrateur/DraggableItem.vue index 1351dc395..2de6f4075 100644 --- a/app/javascript/new_design/administrateur/DraggableItem.vue +++ b/app/javascript/new_design/administrateur/DraggableItem.vue @@ -96,7 +96,7 @@ Modèle