1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #7355 -- Modified urlize utility to handle https:// addresses. Thanks for the report and patch, clint.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2008-06-19 12:05:39 +00:00
parent d943c19428
commit 5da67a084a
2 changed files with 22 additions and 1 deletions

View File

@@ -99,7 +99,7 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False):
lead, middle, trail = match.groups()
if safe_input:
middle = mark_safe(middle)
if middle.startswith('www.') or ('@' not in middle and not middle.startswith('http://') and \
if middle.startswith('www.') or ('@' not in middle and not (middle.startswith('http://') or middle.startswith('https://')) and \
len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \
(middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
middle = 'http://%s' % middle