mirror of https://github.com/django/django.git
Fixed #18071 -- Ignored case sensitivity in urlize utility. Thanks 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
This commit is contained in:
parent
f0697570e9
commit
e2548ec2a9
|
@ -20,8 +20,8 @@ DOTS = [u'·', u'*', u'\u2022', u'•', u'•', u'•']
|
||||||
unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
|
unencoded_ampersands_re = re.compile(r'&(?!(\w+|#\d+);)')
|
||||||
unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
|
unquoted_percents_re = re.compile(r'%(?![0-9A-Fa-f]{2})')
|
||||||
word_split_re = re.compile(r'(\s+)')
|
word_split_re = re.compile(r'(\s+)')
|
||||||
simple_url_re = re.compile(r'^https?://\w')
|
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)$')
|
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+$')
|
simple_email_re = re.compile(r'^\S+@\S+\.\S+$')
|
||||||
link_target_attribute_re = re.compile(r'(<a [^>]*?)target=[^\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)
|
html_gunk_re = re.compile(r'(?:<br clear="all">|<i><\/i>|<b><\/b>|<em><\/em>|<strong><\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE)
|
||||||
|
|
|
@ -292,6 +292,10 @@ class DefaultFiltersTests(TestCase):
|
||||||
self.assertEqual(urlize('email@.stream.ru'),
|
self.assertEqual(urlize('email@.stream.ru'),
|
||||||
u'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):
|
def test_wordcount(self):
|
||||||
self.assertEqual(wordcount(''), 0)
|
self.assertEqual(wordcount(''), 0)
|
||||||
self.assertEqual(wordcount(u'oneword'), 1)
|
self.assertEqual(wordcount(u'oneword'), 1)
|
||||||
|
|
Loading…
Reference in New Issue