diff --git a/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb b/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb index 6dc0f3b..c86e8d4 100644 --- a/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb +++ b/app/forms/concerns/decidim/friendly_signup/registration_form_override.rb @@ -7,8 +7,9 @@ class RegistrationFormOverride < Decidim::RegistrationForm private + EMAIL_REGEX = /\A[^<>"']+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,}/ def no_special_characters_in_email - errors.add(:email, :invalid) if email =~ /[<>'"]/ + errors.add(:email, :invalid) if email =~ EMAIL_REGEX end end end