Ticket #5657: urlize_ascii_letters.patch

File urlize_ascii_letters.patch, 856 bytes (added by Andrew Stoneman <astoneman@…>, 8 years ago)

patch to use ascii_letters instead of letters

  • django/utils/html.py

     
    8080        if match:
    8181            lead, middle, trail = match.groups()
    8282            if middle.startswith('www.') or ('@' not in middle and not middle.startswith('http://') and \
    83                     len(middle) > 0 and middle[0] in string.letters + string.digits and \
     83                    len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \
    8484                    (middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
    8585                middle = '<a href="http://%s"%s>%s</a>' % (middle, nofollow_attr, trim_url(middle))
    8686            if middle.startswith('http://') or middle.startswith('https://'):
Back to Top