summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-04-01 15:37:37 +0200
committerClaude Paroz <claude@2xlibre.net>2013-04-01 15:37:37 +0200
commitb474ffe63a3f99daeef2324a674f7ddfbb653c41 (patch)
tree9f7c4f07639ecb773ac2f8d7cdeded51569fb773 /django/utils/html.py
parent2bcbca3451cf7738d8e88c20023f9e799a044e9d (diff)
Fixed #20172 -- Ensured urlize supports IPv4/IPv6 addresses
Thanks Marc Aymerich for the report and the initial patch.
Diffstat (limited to 'django/utils/html.py')
-rw-r--r--django/utils/html.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/html.py b/django/utils/html.py
index a9ebd17935..650e8485ab 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -26,7 +26,7 @@ DOTS = ['&middot;', '*', '\u2022', '&#149;', '&bull;', '&#8226;']
unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
word_split_re = re.compile(r'(\s+)')
-simple_url_re = re.compile(r'^https?://\w', re.IGNORECASE)
+simple_url_re = re.compile(r'^https?://\[?\w', re.IGNORECASE)
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE)
simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
link_target_attribute_re = re.compile(r'(<a [^>]*?)target=[^\s>]+')