PHP Classes

File: libs/Twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test   Download  
File: libs/Twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 1,268 bytes
 

Contents

Class file image Download
--TEST-- "autoescape" tag handles filters preserving the safety --TEMPLATE-- {% autoescape 'html' %} (preserves_safety is preserving safety for "html") 1. Unsafe values are still unsafe ( var|preserves_safety|escape ) {{ var|preserves_safety }} 2. Safe values are still safe ( var|escape|preserves_safety ) {{ var|escape|preserves_safety }} 3. Re-escape values that are escaped for an other contexts ( var|escape_something|preserves_safety|escape ) {{ var|escape_something|preserves_safety }} 4. Still escape when using filters not declared safe ( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) {{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} {% endautoescape %} --DATA-- return array('var' => "<Fabien>\nTwig") --EXPECT-- (preserves_safety is preserving safety for "html") 1. Unsafe values are still unsafe ( var|preserves_safety|escape ) &lt;FABIEN&gt; TWIG 2. Safe values are still safe ( var|escape|preserves_safety ) &LT;FABIEN&GT; TWIG 3. Re-escape values that are escaped for an other contexts ( var|escape_something|preserves_safety|escape ) &lt;FABIEN&gt; TWIG 4. Still escape when using filters not declared safe ( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) &amp;LT;FABPOT&amp;GT; TWIG