From 7feb7eeba7e591f7a0c1cbf3b72efb099bd9f644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Wickstr=C3=B6m?= Date: Mon, 9 Mar 2015 13:24:22 +0200 Subject: [PATCH] Use a more liberal/naive approach to regex checking for an email 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 @. so we still have some mail characteristics in the URL. --- hijack/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hijack/urls.py b/hijack/urls.py index b6fc3735..9b0281a4 100644 --- a/hijack/urls.py +++ b/hijack/urls.py @@ -14,7 +14,7 @@ if not hijacking_user_attributes or 'email' in hijacking_user_attributes: urlpatterns += patterns('hijack.views', - url(r'^email/(?P[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/$', 'login_with_email', name='login_with_email') + url(r'^email/(?P[^@]+@[^@]+\.[^@]+)/$', 'login_with_email', name='login_with_email') ) if not hijacking_user_attributes or 'username' in hijacking_user_attributes: urlpatterns += patterns('hijack.views',