Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Quotes may also be part of the email name #234

Closed
wants to merge 1 commit into from

1 participant

Hans de Graaff
Hans de Graaff

I just ran into an account that had a single quote as part of the email name. According to my reading of RFC 2822 this is indeed valid, so I've changed the email name regex to match this.

Deleted user

This has been pulled in from alternate pull request. Thanks.

Deleted user ghost closed this
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  lib/authlogic/regex.rb
View
@@ -10,7 +10,7 @@ module Regex
# for regular expressions.
def self.email
return @email_regex if @email_regex
- email_name_regex = '[A-Z0-9_\.%\+\-]+'
+ email_name_regex = '[A-Z0-9_\.%\+\-\']+'
domain_head_regex = '(?:[A-Z0-9\-]+\.)+'
domain_tld_regex = '(?:[A-Z]{2,4}|museum|travel)'
@email_regex = /^#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}$/i
6 test/acts_as_authentic_test/email_test.rb
View
@@ -81,6 +81,10 @@ def test_validates_format_of_email_field
u.email = "dakota.dux+1@gmail.com"
u.valid?
assert u.errors[:email].size == 0
+
+ u.email = "a'quote@mydomain.com"
+ u.valid?
+ assert u.errors[:email].size == 0
end
def test_validates_uniqueness_of_email_field
@@ -98,4 +102,4 @@ def test_validates_uniqueness_of_email_field
assert u.errors[:email].size == 0
end
end
-end
+end
Something went wrong with that request. Please try again.