mirror of
https://github.com/django/django.git
synced 2025-11-02 21:03:53 +00:00
Fixed #16395 -- Prevented urlize from highlighting some malformed URLs. Thanks BernhardEssl for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
40f0ecc56a
commit
27508918fb
2 changed files with 12 additions and 4 deletions
|
|
@ -268,6 +268,14 @@ class DefaultFiltersTests(TestCase):
|
|||
self.assertEqual(urlize('info@c✶.org'),
|
||||
u'<a href="mailto:info@xn--c-lgq.org">info@c✶.org</a>')
|
||||
|
||||
# Check urlize doesn't highlight malformed URIs - see #16395
|
||||
self.assertEqual(urlize('http:///www.google.com'),
|
||||
u'http:///www.google.com')
|
||||
self.assertEqual(urlize('http://.google.com'),
|
||||
u'http://.google.com')
|
||||
self.assertEqual(urlize('http://@foo.com'),
|
||||
u'http://@foo.com')
|
||||
|
||||
def test_wordcount(self):
|
||||
self.assertEqual(wordcount(''), 0)
|
||||
self.assertEqual(wordcount(u'oneword'), 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue