Avoid converting conditional restriction tags into emails

Fixes #3884
This commit is contained in:
Andy Allan 2023-02-01 18:57:16 +00:00
parent ccaff5c40e
commit c226d8e85e
2 changed files with 11 additions and 2 deletions

View file

@ -125,7 +125,10 @@ module BrowseTagsHelper
nil
end
def email_link(_key, value)
def email_link(key, value)
# Avoid converting conditional tags into emails, since EMAIL_REGEXP is quite permissive
return nil unless %w[email contact:email].include? key
# Does the value look like an email? eg "someone@domain.tld"
# Uses Ruby built-in regexp to validate email.