From e4b8686e3cf909006e92d3a94271d143d5a2697c Mon Sep 17 00:00:00 2001 From: Paul Hayes Date: Thu, 31 Mar 2016 16:19:15 +0100 Subject: [PATCH] Remove unnecessary email regexp This is now handled by the admin gem itself, in the JS layer: https://github.com/alphagov/govuk_admin_template/pull/121 --- app/helpers/admin/analytics_helper.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/helpers/admin/analytics_helper.rb b/app/helpers/admin/analytics_helper.rb index 07494cb1d94..35370cd65e4 100644 --- a/app/helpers/admin/analytics_helper.rb +++ b/app/helpers/admin/analytics_helper.rb @@ -4,15 +4,8 @@ def track_analytics_data(type, message) { 'module' => 'auto-track-event', 'track-action' => "alert-#{type}", - 'track-label' => flash_text_without_email_addresses(message), + 'track-label' => strip_tags(message), } end - - def flash_text_without_email_addresses(message) - text_message = strip_tags(message) - - # redact email addresses so they aren't passed to GA - text_message.gsub(/\S+@\S+/, '[email]') - end end end