Code

Ticket #4833: 4833.diff

File 4833.diff, 773 bytes (added by ikelly, 7 years ago)
Line 
1Index: django/core/validators.py
2===================================================================
3--- django/core/validators.py   (revision 6298)
4+++ django/core/validators.py   (working copy)
5@@ -30,7 +30,7 @@
6 email_re = re.compile(
7     r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
8     r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"' # quoted-string
9-    r')@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}$', re.IGNORECASE)  # domain
10+    r')@(?:[A-Z0-9-]+(?:\.(?!$)|$))+$', re.IGNORECASE)  # domain
11 integer_re = re.compile(r'^-?\d+$')
12 ip4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
13 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)