summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
authorLarryBrid <jcameronfulton@gmail.com>2014-07-03 16:37:56 -0400
committerClaude Paroz <claude@2xlibre.net>2014-07-04 09:00:16 +0200
commit1bb1d3168b813e050df757ff40cdaf2feab45fdb (patch)
treed372ff1b482efa07def765485f6c7ac85434cafa /django/utils/html.py
parent814bcc33951db8a469b9bba26fb021fc2d8ad480 (diff)
Updated urlize regex following a93ee5112d4
Prevent urlize from turning some.organization, an.intern etc. into urls. Refs #22941.
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 1ab27b4461..38fe90d1a9 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -25,7 +25,7 @@ DOTS = ['&middot;', '*', '\u2022', '&#149;', '&bull;', '&#8226;']
unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
word_split_re = re.compile(r'(\s+)')
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_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>]+')
html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)