Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix to allow apostrophe's in email addresses #240

Merged
2 commits merged into from

1 participant

@neilmiddleton

Apostrophe's are allowed, but not by the authlogic regex

@ghost ghost merged commit 9805787 into from
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.
View
2  lib/authlogic/regex.rb
@@ -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
View
4 test/acts_as_authentic_test/email_test.rb
@@ -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 = "dakota.d'ux@gmail.com"
+ u.valid?
+ assert u.errors[:email].size == 0
end
def test_validates_uniqueness_of_email_field
Something went wrong with that request. Please try again.