diff options
| author | Tim Graham <timograham@gmail.com> | 2015-08-18 10:09:17 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:09 -0400 |
| commit | 222d0633010e2f37f9fbd2d0559ecc4a5643c738 (patch) | |
| tree | 5f8fce14ce26c2ae0e3548c7a6c07cdc0389082b /docs/ref/templates | |
| parent | 785cc71d5b3300e2702b0b2fc7316e58ca70b563 (diff) | |
Refs #23269 -- Removed the removetags template tag and related functions per deprecation timeline.
Diffstat (limited to 'docs/ref/templates')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 9bf22e4740..1623ff357b 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1866,44 +1866,6 @@ For example:: If ``value`` is the list ``['a', 'b', 'c', 'd']``, the output could be ``"b"``. -.. templatefilter:: removetags - -removetags -^^^^^^^^^^ - -.. deprecated:: 1.8 - - ``removetags`` cannot guarantee HTML safe output and has been deprecated due - to security concerns. Consider using `bleach`_ instead. - -.. _bleach: http://bleach.readthedocs.org/en/latest/ - -Removes a space-separated list of [X]HTML tags from the output. - -For example:: - - {{ value|removetags:"b span" }} - -If ``value`` is ``"<b>Joel</b> <button>is</button> a <span>slug</span>"`` the -unescaped output will be ``"Joel <button>is</button> a slug"``. - -Note that this filter is case-sensitive. - -If ``value`` is ``"<B>Joel</B> <button>is</button> a <span>slug</span>"`` the -unescaped output will be ``"<B>Joel</B> <button>is</button> a slug"``. - -.. admonition:: No safety guarantee - - Note that ``removetags`` doesn't give any guarantee about its output being - HTML safe. In particular, it doesn't work recursively, so an input like - ``"<sc<script>ript>alert('XSS')</sc</script>ript>"`` won't be safe even if - you apply ``|removetags:"script"``. So if the input is user provided, - **NEVER** apply the ``safe`` filter to a ``removetags`` output. If you are - looking for something more robust, you can use the ``bleach`` Python - library, notably its `clean`_ method. - -.. _clean: http://bleach.readthedocs.org/en/latest/clean.html - .. templatefilter:: rjust rjust |
