Ticket #13704: django.diff
File django.diff, 975 bytes (added by , 14 years ago) |
---|
-
django/utils/html.py
2 2 3 3 import re 4 4 import string 5 from urlparse import urlparse, urlunparse 5 6 6 7 from django.utils.safestring import SafeData, mark_safe 7 8 from django.utils.encoding import force_unicode … … 104 105 # Make URL we want to point to. 105 106 url = None 106 107 if middle.startswith('http://') or middle.startswith('https://'): 108 try: 109 middle = urlparse(middle) 110 middle = urlunparse( ( middle.scheme, middle.netloc.encode('idna'), middle.path, middle.params, middle.query, middle.fragment ) ) 111 except: 112 pass 107 113 url = urlquote(middle, safe='/&=:;#?+*') 108 114 elif middle.startswith('www.') or ('@' not in middle and \ 109 115 middle and middle[0] in string.ascii_letters + string.digits and \