Django

Code

Ticket #5657: urlize_ascii_letters.patch

File urlize_ascii_letters.patch, 0.8 kB (added by Andrew Stoneman <astoneman@gmail.com>, 10 months ago)

patch to use ascii_letters instead of letters

  • django/utils/html.py

    old new  
    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://'):