Skip to content

Commit

Permalink
Fixed django#18071 -- Ignored case sensitivity in urlize utility. Tha…
Browse files Browse the repository at this point in the history
…nks luke@creaturecreative.com and adamzap for the report and the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
claudep committed Apr 11, 2012
1 parent f069757 commit e2548ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/utils/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
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')
simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$')
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>]+')
html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)
Expand Down
4 changes: 4 additions & 0 deletions tests/regressiontests/defaultfilters/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ def test_urlize(self):
self.assertEqual(urlize('email@.stream.ru'),
u'email@.stream.ru')

# Check urlize accepts uppercased URL schemes - see #18071
self.assertEqual(urlize('HTTPS://github.com/'),
u'<a href="https://github.com/" rel="nofollow">HTTPS://github.com/</a>')

def test_wordcount(self):
self.assertEqual(wordcount(''), 0)
self.assertEqual(wordcount(u'oneword'), 1)
Expand Down

0 comments on commit e2548ec

Please sign in to comment.