Ticket #3421: url_re.2.patch
File url_re.2.patch, 1.1 KB (added by , 17 years ago) |
---|
-
django/newforms/fields.py
337 337 338 338 url_re = re.compile( 339 339 r'^https?://' # http:// or https:// 340 r'(?:[A-Z0-9-]+\.)+[A-Z]{2,6}' # domain 340 r'(?:(?:[A-Z0-9-]+\.)+[A-Z]{2,6}|' #domain... 341 r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip 341 342 r'(?::\d+)?' # optional port 342 343 r'(?:/?|/\S+)$', re.IGNORECASE) 343 344 -
tests/regressiontests/forms/tests.py
1585 1585 u'http://example.com' 1586 1586 >>> f.clean('http://www.example.com') 1587 1587 u'http://www.example.com' 1588 >>> f.clean('http://www.example.com:8000/test') 1589 u'http://www.example.com:8000/test' 1590 >>> f.clean('http://200.8.9.10') 1591 u'http://200.8.9.10' 1592 >>> f.clean('http://200.8.9.10:8000/test') 1593 u'http://200.8.9.10:8000/test' 1588 1594 >>> f.clean('foo') 1589 1595 Traceback (most recent call last): 1590 1596 ...