From ba86aded2d88255d4664266778a933328d8e4af5 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 27 Mar 2015 09:52:42 +0000 Subject: [PATCH 1/2] As per twigphp/Twig#472, automatic escaping is not yet available While it would be a cool feature, it is also impossible to apply automatic escaping in most cases. Advertising this as a out-of-the-box feature is problematic, as it probably mislead multiple developers that are using the tool without applying proper contextual escaping. --- book/templating.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/templating.rst b/book/templating.rst index afc1c79365b..24429340237 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -135,7 +135,7 @@ Throughout this chapter, template examples will be shown in both Twig and PHP. web designers everywhere. Twig can also do things that PHP can't, such as whitespace control, - sandboxing, automatic and contextual output escaping, and the inclusion of + sandboxing, manual contextual output escaping, and the inclusion of custom functions and filters that only affect templates. Twig contains little features that make writing templates easier and more concise. Take the following example, which combines a loop with a logical ``if`` From b57ccb054e273b642c61d26bdad8a19c0ddeae16 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 27 Mar 2015 10:31:19 +0000 Subject: [PATCH 2/2] Updating document to clarify that automatic HTML escaping is available --- book/templating.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 24429340237..ff8946987c3 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -135,10 +135,10 @@ Throughout this chapter, template examples will be shown in both Twig and PHP. web designers everywhere. Twig can also do things that PHP can't, such as whitespace control, - sandboxing, manual contextual output escaping, and the inclusion of - custom functions and filters that only affect templates. Twig contains - little features that make writing templates easier and more concise. Take - the following example, which combines a loop with a logical ``if`` + sandboxing, automatic HTML escaping, manual contextual output escaping, + and the inclusion of custom functions and filters that only affect templates. + Twig contains little features that make writing templates easier and more concise. + Take the following example, which combines a loop with a logical ``if`` statement: .. code-block:: html+jinja