mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[1.7.x] Improved strip_tags and clarified documentation
The fact that strip_tags cannot guarantee to really strip all
non-safe HTML content was not clear enough. Also see:
https://www.djangoproject.com/weblog/2014/mar/22/strip-tags-advisory/
Backport of 6ca6c36f82 from master.
This commit is contained in:
@@ -82,6 +82,8 @@ class TestUtilsHtml(TestCase):
|
||||
('a<p a >b</p>c', 'abc'),
|
||||
('d<a:b c:d>e</p>f', 'def'),
|
||||
('<strong>foo</strong><a href="http://example.com">bar</a>', 'foobar'),
|
||||
('<sc<!-- -->ript>test<<!-- -->/script>', 'test'),
|
||||
('<script>alert()</script>&h', 'alert()&h'),
|
||||
)
|
||||
for value, output in items:
|
||||
self.check_output(f, value, output)
|
||||
|
||||
Reference in New Issue
Block a user