Ticket #11551: forms.fields.diff

File forms.fields.diff, 806 bytes (added by adamnelson, 6 years ago)

Allows file:/// url type

  • Users/adam/Development/django-trunk/django/forms/fields.py

     
    532532        return f
    533533
    534534url_re = re.compile(
    535     r'^https?://' # http:// or https://
     535    r'^https?://|file:///?' # http:// or https:// or file:// or file:///
    536536    r'(?:(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}|' #domain...
    537     r'localhost|' #localhost...
     537    r'localhost|' # ... or localhost
    538538    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
    539     r'(?::\d+)?' # optional port
     539    r'(?::\d{1,5})?' # optional port
    540540    r'(?:/?|/\S+)$', re.IGNORECASE)
    541541
    542542class URLField(RegexField):
Back to Top