Skip to content

Commit

Permalink
Remove unnecessary email regexp
Browse files Browse the repository at this point in the history
This is now handled by the admin gem itself, in the JS layer:
alphagov/govuk_admin_template#121
  • Loading branch information
fofr committed Mar 31, 2016
1 parent d159475 commit e4b8686
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions app/helpers/admin/analytics_helper.rb
Expand Up @@ -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

0 comments on commit e4b8686

Please sign in to comment.