Skip to content

Commit

Permalink
Merge pull request #4668 from alphagov/simplify-utf-encode-feedback
Browse files Browse the repository at this point in the history
Remove utf_encode method
  • Loading branch information
KludgeKML authored Mar 5, 2025
2 parents 76dc68b + d0255d9 commit 222cb59
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
add_gem_component_stylesheet("button")
add_gem_component_stylesheet("feedback")

def utf_encode(element)
element.is_a?(String) ? element.encode : element
end

email_regex = /[^\s=\/?&]+(?:@|%40)[^\s=\/?&]+/
url_without_pii = utf_encode(request.original_url.gsub(email_regex, '[email]'))
path_without_pii = utf_encode(request.fullpath.gsub(email_regex, '[email]'))
url_without_pii = request.original_url.gsub(email_regex, '[email]').encode
path_without_pii = request.fullpath.gsub(email_regex, '[email]').encode

disable_ga4 ||= false

Expand Down

0 comments on commit 222cb59

Please sign in to comment.