Ticket #16812: 16812.patch

File 16812.patch, 753 bytes (added by aaugustin, 3 years ago)
  • django/core/validators.py

     
    11import platform
    22import re
     3import urllib
    34import urllib2
    45import urlparse
    56
     
    9293                "User-Agent": self.user_agent,
    9394            }
    9495            url = url.encode('utf-8')
     96            scheme, netloc, path, query, fragment = urlparse.urlsplit(url)
     97            path = urllib.quote(path)
     98            url = urlparse.urlunsplit((scheme, netloc, path, query, fragment))
    9599            broken_error = ValidationError(
    96100                _(u'This URL appears to be a broken link.'), code='invalid_link')
    97101            try:
Back to Top