From: Fabien Potencier Date: Fri, 20 Apr 2012 17:02:27 +0000 (+0200) Subject: merged branch stof/preserve_safe (PR #684) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=43245cbd341a7d21aa4bd66cdfe918c5e37efc48;p=web%2Fkonrad%2Ftwig.git merged branch stof/preserve_safe (PR #684) Commits ------- 0cbf5a0 Added an option to mark filters as preserving the safeness Discussion ---------- Added an option to mark filters as preserving the safeness Closes #678 I haven't written a test for this yet as I don't know how to provide a stub filter (as none of the core filters use this option) for the setup of the testsuite. --------------------------------------------------------------------------- by fabpot at 2012-04-07T20:15:36Z @stof: Can you also add some information in the phpdoc with an example so that people understand more easily when and why you would want to use this new option? Thanks. --------------------------------------------------------------------------- by fabpot at 2012-04-07T20:16:36Z Also, adding a unit test that demonstrates the bug you had in #678 would be good. --------------------------------------------------------------------------- by stof at 2012-04-20T08:33:58Z @fabpot none of the core filters are using this options, so what is the right way to add a test ? --------------------------------------------------------------------------- by fabpot at 2012-04-20T08:36:26Z by defining a filter in the test that uses it. --------------------------------------------------------------------------- by stof at 2012-04-20T08:39:06Z but is it possible to register a filter from the tests with the custom stuff used by Twig ? --------------------------------------------------------------------------- by fabpot at 2012-04-20T08:48:06Z in integrationTest.php, we already have quite a few functions and filters registered. I would just be a matter of adding a new one. --------------------------------------------------------------------------- by stof at 2012-04-20T16:17:01Z @fabpot renamed, tested and squashed --- 43245cbd341a7d21aa4bd66cdfe918c5e37efc48 diff --cc CHANGELOG index 0badb9e,3d31a12..4fd5cb7 --- a/CHANGELOG +++ b/CHANGELOG @@@ -1,6 -1,6 +1,7 @@@ * 1.7.0 (2012-XX-XX) + * added an error when defining two blocks with the same name in a template + * added the preserve_safety option for filters * fixed a PHP notice when trying to access a key on a non-object/array variable * enhanced error reporting when the template file is an instance of SplFileInfo * added Twig_Environment::mergeGlobals()