Skip to content

Commit

Permalink
Use a more liberal/naive approach to regex checking for an email
Browse files Browse the repository at this point in the history
The problem with the old method is that it does not support
- Internationalized TLDs, domains or users, such as .xn--4gbrim domains
- Geographic TLDs, such as .europe
- ICANN-era TLDs, such as .audio and .clothing

The new regex still matches <anything>@<anything>.<anything> so we still have some mail
characteristics in the URL.
  • Loading branch information
Frank Wickström committed Mar 9, 2015
1 parent 0e4ca5a commit 7feb7ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hijack/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if not hijacking_user_attributes or 'email' in hijacking_user_attributes:
urlpatterns += patterns('hijack.views',
url(r'^email/(?P<email>[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/$', 'login_with_email', name='login_with_email')
url(r'^email/(?P<email>[^@]+@[^@]+\.[^@]+)/$', 'login_with_email', name='login_with_email')
)
if not hijacking_user_attributes or 'username' in hijacking_user_attributes:
urlpatterns += patterns('hijack.views',
Expand Down

0 comments on commit 7feb7ee

Please sign in to comment.