1# 2.14.6 (2021-05-16)
2
3 * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)"
4
5# 2.14.5 (2021-05-12)
6
7 * Fix PHP 8.1 compatibility
8 * Throw a proper exception when a template name is an absolute path (as it has never been supported)
9
10# 2.14.4 (2021-03-10)
11
12 * Add the slug filter
13
14# 2.14.3 (2021-01-05)
15
16 * Fix extra bundle compat with older versions of Symfony
17
18# 2.14.2 (2021-01-05)
19
20 * Fix "odd" not working for negative numbers
21
22# 2.14.1 (2020-10-27)
23
24* Fix "include(template_from_string())"
25
26# 2.14.0 (2020-10-21)
27
28 * Fix sandbox support when using "include(template_from_string())"
29 * Make round brackets optional for one argument tests like "same as" or "divisible by"
30 * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a }
31 * Drop PHP 7.1 support
32
33# 2.13.1 (2020-08-05)
34
35 * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag
36 * Fix a regression when not using a space before an operator
37 * Restrict callables to closures in filters
38 * Allow trailing commas in argument lists (in calls as well as definitions)
39
40# 2.13.0 (2020-07-05)
41
42 * Fix options not taken into account when using "Michelf\MarkdownExtra"
43 * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument
44 * Drop support for PHP 7.0
45 * Throw exception in case non-Traversable data is passed to "filter"
46 * Fix context optimization on PHP 7.4
47 * Fix PHP 8 compatibility
48 * Fix ambiguous syntax parsing
49
50# 2.12.5 (2020-02-11)
51
52 * Add a check to ensure that iconv() is defined
53
54# 2.12.4 (2020-02-11)
55
56 * Avoid exceptions when an intl resource is not found
57 * Fix implementation of case-insensitivity for method names
58
59# 2.12.3 (2019-12-28)
60
61 * fixed Symfony 5.0 support for the HTML extra extension
62 * fixed number formatter in Intl extra extension when using a formatter prototype
63
64# 2.12.2 (2019-11-11)
65
66 * added supported for exponential numbers
67
68# 2.12.1 (2019-10-17)
69
70 * added the String extension in the "extra" repositories: "u" filter
71
72# 2.12.0 (2019-10-05)
73
74 * added the spaceship operator ("<=>"), useful when using an arrow function in the "sort" filter
75 * added support for an "arrow" function on the "sort" filter
76 * added the CssInliner extension in the "extra" repositories: "inline_css"
77   filter
78 * added the Inky extension in the "extra" repositories: "inky_to_html" filter
79 * added Intl extension in the "extra" repositories: "country_name",
80   "currency_name", "currency_symbol", "language_name", "locale_name",
81   "timezone_name", "format_currency", "format_number",
82   "format_*_number", "format_datetime", "format_date", and "format_time"
83   filters, and the "country_timezones" function
84 * added the Markdown extension in the "extra" repositories: "markdown_to_html",
85   and "html_to_markdown" filters
86 * added the HtmlExtension extension in the "extra" repositories: "date_uri"
87   filter, and "html_classes" function
88 * optimized "block('foo') ?? 'bar'"
89 * fixed the empty test on Traversable instances
90 * fixed array_key_exists() on objects
91 * fixed cache when opcache is installed but disabled
92 * fixed using macros in arrow functions
93 * fixed split filter on edge case
94
95# 2.11.3 (2019-06-18)
96
97 * display partial output (PHP buffer) when an error occurs in debug mode
98 * fixed the filter filter (allow the result to be used several times)
99 * fixed macro auto-import when a template contains only macros
100
101# 2.11.2 (2019-06-05)
102
103 * fixed macro auto-import
104
105# 2.11.1 (2019-06-04)
106
107 * added support for "Twig\Markup" instances in the "in" test (again)
108 * allowed string operators as variables names in assignments
109 * fixed support for macros defined in parent templates
110
111# 2.11.0 (2019-05-31)
112
113 * added the possibility to register classes/interfaces as being safe for the escaper ("EscaperExtension::addSafeClass()")
114 * deprecated CoreExtension::setEscaper() and CoreExtension::getEscapers() in favor of the same methods on EscaperExtension
115 * macros are now auto-imported in the template they are defined (under the ``_self`` variable)
116 * added support for macros on "is defined" tests
117 * fixed macros "import" when using the same name in the parent and child templates
118 * fixed recursive macros
119 * macros imported "globally" in a template are now available in macros without re-importing them
120 * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance)
121 * fixed a PHP fatal error when calling a macro imported in a block in a nested block
122 * fixed a PHP fatal error when calling a macro imported in the template in another macro
123 * fixed wrong error message on "import" and "from"
124
125# 2.10.0 (2019-05-14)
126
127 * deprecated "if" conditions on "for" tags
128 * added "filter", "map", and "reduce" filters (and support for arrow functions)
129 * fixed partial output leak when a PHP fatal error occurs
130 * optimized context access on PHP 7.4
131
132# 2.9.0 (2019-04-28)
133
134 * deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode()
135 * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning)
136 * deprecated the "filter" tag (use the "apply" tag instead)
137 * added the "apply" tag as a replacement for the "filter" tag
138 * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning)
139 * added support for "Twig\Markup" instances in the "in" test
140 * fixed "import" when macros are stored in a template string
141 * fixed Lexer when using custom options containing the # char
142 * added template line number to twig_get_attribute()
143
144# 2.8.1 (2019-04-16)
145
146 * fixed EscaperNodeVisitor
147 * deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes
148 * deprecated Node::setTemplateName() in favor of Node::setSourceContext()
149
150# 2.8.0 (2019-04-16)
151
152 * added Traversable support for the length filter
153 * fixed some wrong location in error messages
154 * made exception creation faster
155 * made escaping on ternary expressions (?: and ??) more fine-grained
156 * added the possibility to give a nice name to string templates (template_from_string function)
157 * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags)
158 * fixed "include" with "ignore missing" when an error loading occurs in the included template
159 * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#})
160 * added the "column" filter
161
162# 2.7.4 (2019-03-23)
163
164 * fixed variadic support
165 * fixed CheckToStringNode implementation (broken when a function/filter is variadic)
166
167# 2.7.3 (2019-03-21)
168
169 * fixed the spaceless filter so that it behaves like the spaceless tag
170 * fixed BC break on Environment::resolveTemplate()
171 * allowed Traversable objects to be used in the "with" tag
172 * allowed Traversable objects to be used in the "with" tag
173 * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags
174
175# 2.7.2 (2019-03-12)
176
177 * added TemplateWrapper::getTemplateName()
178
179# 2.7.1 (2019-03-12)
180
181 * fixed class aliases
182
183# 2.7.0 (2019-03-12)
184
185 * fixed sandbox security issue (under some circumstances, calling the
186   __toString() method on an object was possible even if not allowed by the
187   security policy)
188 * fixed batch filter clobbers array keys when fill parameter is used
189 * added preserveKeys support for the batch filter
190 * fixed "embed" support when used from "template_from_string"
191 * deprecated passing a Twig\Template to Twig\Environment::load()/Twig\Environment::resolveTemplate()
192 * added the possibility to pass a TemplateWrapper to Twig\Environment::load()
193 * marked Twig\Environment::getTemplateClass() as internal (implementation detail)
194 * improved the performance of the sandbox
195 * deprecated the spaceless tag
196 * added a spaceless filter
197 * added max value to the "random" function
198 * deprecated Twig\Extension\InitRuntimeInterface
199 * deprecated Twig\Loader\ExistsLoaderInterface
200 * deprecated PSR-0 classes in favor of namespaced ones
201 * made namespace classes the default classes (PSR-0 ones are aliases now)
202 * added Twig\Loader\ChainLoader::getLoaders()
203 * removed duplicated directory separator in FilesystemLoader
204 * deprecated the "base_template_class" option on Twig\Environment
205 * deprecated the Twig\Environment::getBaseTemplateClass() and
206   Twig\Environment::setBaseTemplateClass() methods
207 * changed internal code to use the namespaced classes as much as possible
208 * deprecated Twig_Parser::isReservedMacroName()
209
210# 2.6.2 (2019-01-14)
211
212 * fixed regression (key exists check for non ArrayObject objects)
213
214# 2.6.1 (2019-01-14)
215
216 * fixed ArrayObject access with a null value
217 * fixed embedded templates starting with a BOM
218 * fixed using a Twig_TemplateWrapper instance as an argument to extends
219 * fixed error location when calling an undefined block
220 * deprecated passing a string as a source on Twig_Error
221 * switched generated code to use the PHP short array notation
222 * fixed float representation in compiled templates
223 * added a second argument to the join filter (last separator configuration)
224
225# 2.6.0 (2018-12-16)
226
227 * made sure twig_include returns a string
228 * fixed multi-byte UFT-8 in escape('html_attr')
229 * added the "deprecated" tag
230 * added support for dynamically named tests
231 * fixed GlobalsInterface extended class
232 * fixed filesystem loader throwing an exception instead of returning false
233
234# 2.5.0 (2018-07-13)
235
236 * deprecated using the spaceless tag at the root level of a child template (noop anyway)
237 * deprecated the possibility to define a block in a non-capturing block in a child template
238 * added the Symfony ctype polyfill as a dependency
239 * fixed reporting the proper location for errors compiled in templates
240 * fixed the error handling for the optimized extension-based function calls
241 * ensured that syntax errors are triggered with the right line
242 * "js" filter now produces valid JSON
243
244# 2.4.8 (2018-04-02)
245
246 * fixed a regression when using the "default" filter or the "defined" test on non-existing arrays
247
248# 2.4.7 (2018-03-20)
249
250 * optimized runtime performance
251 * optimized parser performance by inlining the constant values
252 * fixed block names unicity
253 * fixed counting children of SimpleXMLElement objects
254 * added missing else clause to avoid infinite loops
255 * fixed .. (range operator) in sandbox policy
256
257# 2.4.6 (2018-03-03)
258
259 * fixed a regression in the way the profiler is registered in templates
260
261# 2.4.5 (2018-03-02)
262
263 * optimized the performance of calling an extension method at runtime
264 * optimized the performance of the dot operator for array and method calls
265 * added an exception when using "===" instead of "same as"
266 * fixed possible array to string conversion concealing actual error
267 * made variable names deterministic in compiled templates
268 * fixed length filter when passing an instance of IteratorAggregate
269 * fixed Environment::resolveTemplate to accept instances of TemplateWrapper
270
271# 2.4.4 (2017-09-27)
272
273 * added Twig_Profiler_Profile::reset()
274 * fixed use TokenParser to return an empty Node
275 * added RuntimeExtensionInterface
276 * added circular reference detection when loading templates
277 * added support for runtime loaders in IntegrationTestCase
278 * fixed deprecation when using Twig_Profiler_Dumper_Html
279 * removed @final from Twig_Profiler_Dumper_Text
280
281# 2.4.3 (2017-06-07)
282
283 * fixed namespaces introduction
284
285# 2.4.2 (2017-06-05)
286
287 * fixed namespaces introduction
288
289# 2.4.1 (2017-06-05)
290
291 * fixed namespaces introduction
292
293# 2.4.0 (2017-06-05)
294
295 * added support for PHPUnit 6 when testing extensions
296 * fixed PHP 7.2 compatibility
297 * fixed template name generation in Twig_Environment::createTemplate()
298 * removed final tag on Twig_TokenParser_Include
299 * dropped HHVM support
300 * added namespaced aliases for all (non-deprecated) classes and interfaces
301 * marked Twig_Filter, Twig_Function, Twig_Test, Twig_Node_Module and Twig_Profiler_Profile as final via the @final annotation
302
303# 2.3.2 (2017-04-20)
304
305 * fixed edge case in the method cache for Twig attributes
306
307# 2.3.1 (2017-04-18)
308
309 * fixed the empty() test
310
311# 2.3.0 (2017-03-22)
312
313 * fixed a race condition handling when writing cache files
314 * "length" filter now returns string length when applied to an object that does
315   not implement \Countable but provides __toString()
316 * "empty" test will now consider the return value of the __toString() method for
317   objects implement __toString() but not \Countable
318 * fixed JS escaping for unicode characters with higher code points
319 * added error message when calling `parent()` in a block that doesn't exist in the parent template
320
321# 2.2.0 (2017-02-26)
322
323 * added a PSR-11 compatible runtime loader
324 * added `side` argument to `trim` to allow left or right trimming only.
325
326# 2.1.0 (2017-01-11)
327
328 * fixed twig_get_attribute()
329 * added Twig_NodeCaptureInterface for nodes that capture all output
330
331# 2.0.0 (2017-01-05)
332
333 * removed the C extension
334 * moved Twig_Environment::getAttribute() to twig_get_attribute()
335 * removed Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler()
336 * removed Twig_Compiler::getFilename()
337 * added hasser support in Twig_Template::getAttribute()
338 * sped up the json_encode filter
339 * removed reserved macro names; all names can be used as macro
340 * removed Twig_Template::getEnvironment()
341 * changed _self variable to return the current template name
342 * made the loader a required argument of Twig_Environment constructor
343 * removed Twig_Environment::clearTemplateCache()
344 * removed Twig_Autoloader (use Composer instead)
345 * removed `true` as an equivalent to `html` for the auto-escaping strategy
346 * removed pre-1.8 autoescape tag syntax
347 * dropped support for PHP 5.x
348 * removed the ability to register a global variable after the runtime or the extensions have been initialized
349 * improved the performance of the filesystem loader
350 * removed features that were deprecated in 1.x
351
352# 1.44.4 (2021-XX-XX)
353
354 * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)"
355
356# 1.44.3 (2021-05-12)
357
358 * Fix PHP 8.1 compatibility
359 * Throw a proper exception when a template name is an absolute path (as it has never been supported)
360
361# 1.44.2 (2021-01-05)
362
363 * Fix "odd" not working for negative numbers
364
365# 1.44.1 (2020-10-27)
366
367 * Fix "include(template_from_string())"
368
369# 1.44.0 (2020-10-21)
370
371 * Remove implicit dependency on ext/iconv in JS escaper
372 * Fix sandbox support when using "include(template_from_string())"
373 * Make round brackets optional for one argument tests like "same as" or "divisible by"
374 * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a }
375 * Fix filter(), map(), and reduce() to throw a RuntimeError instead of a PHP TypeError
376 * Drop PHP 7.1 support
377
378# 1.43.1 (2020-08-05)
379
380 * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag
381 * Fix a regression when not using a space before an operator
382 * Restrict callables to closures in filters
383 * Allow trailing commas in argument lists (in calls as well as definitions)
384
385# 1.43.0 (2020-07-05)
386
387 * Throw exception in case non-Traversable data is passed to "filter"
388 * Fix context optimization on PHP 7.4
389 * Fix PHP 8 compatibility
390 * Drop PHP 5.5 5.6, and 7.0 support
391 * Fix ambiguous syntax parsing
392 * In sandbox, the `filter`, `map` and `reduce` filters require Closures in `arrow` parameter
393
394# 1.42.5 (2020-02-11)
395
396 * Fix implementation of case-insensitivity for method names
397
398# 1.42.4 (2019-11-11)
399
400 * optimized "block('foo') ?? 'bar"
401 * added supported for exponential numbers
402
403# 1.42.3 (2019-08-24)
404
405 * fixed the "split" filter when the delimiter is "0"
406 * fixed the "empty" test on Traversable instances
407 * fixed cache when opcache is installed but disabled
408 * fixed PHP 7.4 compatibility
409 * bumped the minimal PHP version to 5.5
410
411# 1.42.2 (2019-06-18)
412
413 * Display partial output (PHP buffer) when an error occurs in debug mode
414
415# 1.42.1 (2019-06-04)
416
417 * added support for "Twig\Markup" instances in the "in" test (again)
418 * allowed string operators as variables names in assignments
419
420# 1.42.0 (2019-05-31)
421
422 * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance)
423 * fixed a PHP fatal error when calling a macro imported in a block in a nested block
424 * fixed a PHP fatal error when calling a macro imported in the template in another macro
425 * fixed wrong error message on "import" and "from"
426
427# 1.41.0 (2019-05-14)
428
429 * fixed support for PHP 7.4
430 * added "filter", "map", and "reduce" filters (and support for arrow functions)
431 * fixed partial output leak when a PHP fatal error occurs
432 * optimized context access on PHP 7.4
433
434# 1.40.1 (2019-04-29)
435
436# fixed regression in NodeTraverser
437
438# 1.40.0 (2019-04-28)
439
440 * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning)
441 * added the "apply" tag as a replacement for the "filter" tag
442 * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning)
443 * added support for "Twig\Markup" instances in the "in" test
444 * fixed Lexer when using custom options containing the # char
445 * fixed "import" when macros are stored in a template string
446
447# 1.39.1 (2019-04-16)
448
449 * fixed EscaperNodeVisitor
450
451# 1.39.0 (2019-04-16)
452
453 * added Traversable support for the length filter
454 * fixed some wrong location in error messages
455 * made exception creation faster
456 * made escaping on ternary expressions (?: and ??) more fine-grained
457 * added the possibility to give a nice name to string templates (template_from_string function)
458 * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags)
459 * fixed "include" with "ignore missing" when an error loading occurs in the included template
460 * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#})
461
462# 1.38.4 (2019-03-23)
463
464 * fixed CheckToStringNode implementation (broken when a function/filter is variadic)
465
466# 1.38.3 (2019-03-21)
467
468 * fixed the spaceless filter so that it behaves like the spaceless tag
469 * fixed BC break on Environment::resolveTemplate()
470 * fixed the bundled Autoloader to also load namespaced classes
471 * allowed Traversable objects to be used in the "with" tag
472 * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags
473
474# 1.38.2 (2019-03-12)
475
476 * added TemplateWrapper::getTemplateName()
477
478# 1.38.1 (2019-03-12)
479
480 * fixed class aliases
481
482# 1.38.0 (2019-03-12)
483
484 * fixed sandbox security issue (under some circumstances, calling the
485   __toString() method on an object was possible even if not allowed by the
486   security policy)
487 * fixed batch filter clobbers array keys when fill parameter is used
488 * added preserveKeys support for the batch filter
489 * fixed "embed" support when used from "template_from_string"
490 * added the possibility to pass a TemplateWrapper to Twig\Environment::load()
491 * improved the performance of the sandbox
492 * added a spaceless filter
493 * added max value to the "random" function
494 * made namespace classes the default classes (PSR-0 ones are aliases now)
495 * removed duplicated directory separator in FilesystemLoader
496 * added Twig\Loader\ChainLoader::getLoaders()
497 * changed internal code to use the namespaced classes as much as possible
498
499# 1.37.1 (2019-01-14)
500
501 * fixed regression (key exists check for non ArrayObject objects)
502 * fixed logic in TemplateWrapper
503
504# 1.37.0 (2019-01-14)
505
506 * fixed ArrayObject access with a null value
507 * fixed embedded templates starting with a BOM
508 * fixed using a Twig_TemplateWrapper instance as an argument to extends
509 * switched generated code to use the PHP short array notation
510 * dropped PHP 5.3 support
511 * fixed float representation in compiled templates
512 * added a second argument to the join filter (last separator configuration)
513
514# 1.36.0 (2018-12-16)
515
516 * made sure twig_include returns a string
517 * fixed multi-byte UFT-8 in escape('html_attr')
518 * added the "deprecated" tag
519 * added support for dynamically named tests
520 * fixed GlobalsInterface extended class
521 * fixed filesystem loader throwing an exception instead of returning false
522
523# 1.35.4 (2018-07-13)
524
525 * ensured that syntax errors are triggered with the right line
526 * added the Symfony ctype polyfill as a dependency
527 * "js" filter now produces valid JSON
528
529# 1.35.3 (2018-03-20)
530
531 * fixed block names unicity
532 * fixed counting children of SimpleXMLElement objects
533 * added missing else clause to avoid infinite loops
534 * fixed .. (range operator) in sandbox policy
535
536# 1.35.2 (2018-03-03)
537
538 * fixed a regression in the way the profiler is registered in templates
539
540# 1.35.1 (2018-03-02)
541
542 * added an exception when using "===" instead of "same as"
543 * fixed possible array to string conversion concealing actual error
544 * made variable names deterministic in compiled templates
545 * fixed length filter when passing an instance of IteratorAggregate
546 * fixed Environment::resolveTemplate to accept instances of TemplateWrapper
547
548# 1.35.0 (2017-09-27)
549
550 * added Twig_Profiler_Profile::reset()
551 * fixed use TokenParser to return an empty Node
552 * added RuntimeExtensionInterface
553 * added circular reference detection when loading templates
554
555# 1.34.4 (2017-07-04)
556
557 * added support for runtime loaders in IntegrationTestCase
558 * fixed deprecation when using Twig_Profiler_Dumper_Html
559
560# 1.34.3 (2017-06-07)
561
562 * fixed namespaces introduction
563
564# 1.34.2 (2017-06-05)
565
566 * fixed namespaces introduction
567
568# 1.34.1 (2017-06-05)
569
570 * fixed namespaces introduction
571
572# 1.34.0 (2017-06-05)
573
574 * added support for PHPUnit 6 when testing extensions
575 * fixed PHP 7.2 compatibility
576 * fixed template name generation in Twig_Environment::createTemplate()
577 * removed final tag on Twig_TokenParser_Include
578 * added namespaced aliases for all (non-deprecated) classes and interfaces
579 * dropped HHVM support
580 * dropped PHP 5.2 support
581
582# 1.33.2 (2017-04-20)
583
584 * fixed edge case in the method cache for Twig attributes
585
586# 1.33.1 (2017-04-18)
587
588 * fixed the empty() test
589
590# 1.33.0 (2017-03-22)
591
592 * fixed a race condition handling when writing cache files
593 * "length" filter now returns string length when applied to an object that does
594   not implement \Countable but provides __toString()
595 * "empty" test will now consider the return value of the __toString() method for
596   objects implement __toString() but not \Countable
597 * fixed JS escaping for unicode characters with higher code points
598
599# 1.32.0 (2017-02-26)
600
601 * fixed deprecation notice in Twig_Util_DeprecationCollector
602 * added a PSR-11 compatible runtime loader
603 * added `side` argument to `trim` to allow left or right trimming only.
604
605# 1.31.0 (2017-01-11)
606
607 * added Twig_NodeCaptureInterface for nodes that capture all output
608 * fixed marking the environment as initialized too early
609 * fixed C89 compat for the C extension
610 * turned fatal error into exception when a previously generated cache is corrupted
611 * fixed offline cache warm-ups for embedded templates
612
613# 1.30.0 (2016-12-23)
614
615 * added Twig_FactoryRuntimeLoader
616 * deprecated function/test/filter/tag overriding
617 * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr
618
619# 1.29.0 (2016-12-13)
620
621 * fixed sandbox being left enabled if an exception is thrown while rendering
622 * marked some classes as being final (via @final)
623 * made Twig_Error report real source path when possible
624 * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }})
625 * deprecated silent display of undefined blocks
626 * deprecated support for mbstring.func_overload != 0
627
628# 1.28.2 (2016-11-23)
629
630 * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute()
631 * improved a deprecation message
632
633# 1.28.1 (2016-11-18)
634
635 * fixed block() function when used with a template argument
636
637# 1.28.0 (2016-11-17)
638
639 * added support for the PHP 7 null coalescing operator for the ?? Twig implementation
640 * exposed a way to access template data and methods in a portable way
641 * changed context access to use the PHP 7 null coalescing operator when available
642 * added the "with" tag
643 * added support for a custom template on the block() function
644 * added "is defined" support for block() and constant()
645 * optimized the way attributes are fetched
646
647# 1.27.0 (2016-10-25)
648
649 * deprecated Twig_Parser::getEnvironment()
650 * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
651 * deprecated Twig_Compiler::addIndentation()
652 * fixed regression when registering two extensions having the same class name
653 * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
654 * fixed the filesystem loader with relative paths
655 * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine()
656 * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext()
657 * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName()
658 * deprecated the "filename" escaping strategy (use "name" instead)
659 * added Twig_Source to hold information about the original template
660 * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName()
661 * deprecated Parser::getFilename()
662 * fixed template paths when a template name contains a protocol like vfs://
663 * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties
664
665# 1.26.1 (2016-10-05)
666
667 * removed template source code from generated template classes when debug is disabled
668 * fixed default implementation of Twig_Template::getDebugInfo() for better BC
669 * fixed regression on static calls for functions/filters/tests
670
671# 1.26.0 (2016-10-02)
672
673 * added template cache invalidation based on more environment options
674 * added a missing deprecation notice
675 * fixed template paths when a template is stored in a PHAR file
676 * allowed filters/functions/tests implementation to use a different class than the extension they belong to
677 * deprecated Twig_ExtensionInterface::getName()
678
679# 1.25.0 (2016-09-21)
680
681 * changed the way we store template source in template classes
682 * removed usage of realpath in cache keys
683 * fixed Twig cache sharing when used with different versions of PHP
684 * removed embed parent workaround for simple use cases
685 * deprecated the ability to store non Node instances in Node::$nodes
686 * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler()
687 * deprecated Twig_Compiler::getFilename()
688
689# 1.24.2 (2016-09-01)
690
691 * fixed static callables
692 * fixed a potential PHP warning when loading the cache
693 * fixed a case where the autoescaping does not work as expected
694
695# 1.24.1 (2016-05-30)
696
697 * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
698 * fixed support for PHP7 (Throwable support)
699 * marked the following methods as being internals on Twig_Environment:
700   getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
701   getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
702   getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
703
704# 1.24.0 (2016-01-25)
705
706 * adding support for the ?? operator
707 * fixed the defined test when used on a constant, a map, or a sequence
708 * undeprecated _self (should only be used to get the template name, not the template instance)
709 * fixed parsing on PHP7
710
711# 1.23.3 (2016-01-11)
712
713 * fixed typo
714
715# 1.23.2 (2015-01-11)
716
717 * added versions in deprecated messages
718 * made file cache tolerant for trailing (back)slashes on directory configuration
719 * deprecated unused Twig_Node_Expression_ExtensionReference class
720
721# 1.23.1 (2015-11-05)
722
723 * fixed some exception messages which triggered PHP warnings
724 * fixed BC on Twig_Test_NodeTestCase
725
726# 1.23.0 (2015-10-29)
727
728 * deprecated the possibility to override an extension by registering another one with the same name
729 * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC)
730 * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC)
731 * deprecated Twig_Environment::computeAlternatives()
732
733# 1.22.3 (2015-10-13)
734
735 * fixed regression when using null as a cache strategy
736 * improved performance when checking template freshness
737 * fixed warnings when loaded templates do not exist
738 * fixed template class name generation to prevent possible collisions
739 * fixed logic for custom escapers to call them even on integers and null values
740 * changed template cache names to take into account the Twig C extension
741
742# 1.22.2 (2015-09-22)
743
744 * fixed a race condition in template loading
745
746# 1.22.1 (2015-09-15)
747
748 * fixed regression in template_from_string
749
750# 1.22.0 (2015-09-13)
751
752 * made Twig_Test_IntegrationTestCase more flexible
753 * added an option to force PHP bytecode invalidation when writing a compiled template into the cache
754 * fixed the profiler duration for the root node
755 * changed template cache names to take into account enabled extensions
756 * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(),
757   Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
758 * added a way to override the filesystem template cache system
759 * added a way to get the original template source from Twig_Template
760
761# 1.21.2 (2015-09-09)
762
763 * fixed variable names for the deprecation triggering code
764 * fixed escaping strategy detection based on filename
765 * added Traversable support for replace, merge, and sort
766 * deprecated support for character by character replacement for the "replace" filter
767
768# 1.21.1 (2015-08-26)
769
770 * fixed regression when using the deprecated Twig_Test_* classes
771
772# 1.21.0 (2015-08-24)
773
774 * added deprecation notices for deprecated features
775 * added a deprecation "framework" for filters/functions/tests and test fixtures
776
777# 1.20.0 (2015-08-12)
778
779 * forbid access to the Twig environment from templates and internal parts of Twig_Template
780 * fixed limited RCEs when in sandbox mode
781 * deprecated Twig_Template::getEnvironment()
782 * deprecated the _self variable for usage outside of the from and import tags
783 * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
784   between 1.x and 2.x
785
786# 1.19.0 (2015-07-31)
787
788 * fixed wrong error message when including an undefined template in a child template
789 * added support for variadic filters, functions, and tests
790 * added support for extra positional arguments in macros
791 * added ignore_missing flag to the source function
792 * fixed batch filter with zero items
793 * deprecated Twig_Environment::clearTemplateCache()
794 * fixed sandbox disabling when using the include function
795
796# 1.18.2 (2015-06-06)
797
798 * fixed template/line guessing in exceptions for nested templates
799 * optimized the number of inodes and the size of realpath cache when using the cache
800
801# 1.18.1 (2015-04-19)
802
803 * fixed memory leaks in the C extension
804 * deprecated Twig_Loader_String
805 * fixed the slice filter when used with a SimpleXMLElement object
806 * fixed filesystem loader when trying to load non-files (like directories)
807
808# 1.18.0 (2015-01-25)
809
810 * fixed some error messages where the line was wrong (unknown variables or argument names)
811 * added a new way to customize the main Module node (via empty nodes)
812 * added Twig_Environment::createTemplate() to create a template from a string
813 * added a profiler
814 * fixed filesystem loader cache when different file paths are used for the same template
815
816# 1.17.0 (2015-01-14)
817
818 * added a 'filename' autoescaping strategy, which dynamically chooses the
819   autoescaping strategy for a template based on template file extension.
820
821# 1.16.3 (2014-12-25)
822
823 * fixed regression for dynamic parent templates
824 * fixed cache management with statcache
825 * fixed a regression in the slice filter
826
827# 1.16.2 (2014-10-17)
828
829 * fixed timezone on dates as strings
830 * fixed 2-words test names when a custom node class is not used
831 * fixed macros when using an argument named like a PHP super global (like GET or POST)
832 * fixed date_modify when working with DateTimeImmutable
833 * optimized for loops
834 * fixed multi-byte characters handling in the split filter
835 * fixed a regression in the in operator
836 * fixed a regression in the slice filter
837
838# 1.16.1 (2014-10-10)
839
840 * improved error reporting in a sandboxed template
841 * fixed missing error file/line information under certain circumstances
842 * fixed wrong error line number in some error messages
843 * fixed the in operator to use strict comparisons
844 * sped up the slice filter
845 * fixed for mb function overload mb_substr acting different
846 * fixed the attribute() function when passing a variable for the arguments
847
848# 1.16.0 (2014-07-05)
849
850 * changed url_encode to always encode according to RFC 3986
851 * fixed inheritance in a 'use'-hierarchy
852 * removed the __toString policy check when the sandbox is disabled
853 * fixed recursively calling blocks in templates with inheritance
854
855# 1.15.1 (2014-02-13)
856
857 * fixed the conversion of the special '0000-00-00 00:00' date
858 * added an error message when trying to import an undefined block from a trait
859 * fixed a C extension crash when accessing defined but uninitialized property.
860
861# 1.15.0 (2013-12-06)
862
863 * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
864 * added min and max functions
865 * added the round filter
866 * fixed a bug that prevented the optimizers to be enabled/disabled selectively
867 * fixed first and last filters for UTF-8 strings
868 * added a source function to include the content of a template without rendering it
869 * fixed the C extension sandbox behavior when get or set is prepend to method name
870
871# 1.14.2 (2013-10-30)
872
873 * fixed error filename/line when an error occurs in an included file
874 * allowed operators that contain whitespaces to have more than one whitespace
875 * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")
876
877# 1.14.1 (2013-10-15)
878
879 * made it possible to use named operators as variables
880 * fixed the possibility to have a variable named 'matches'
881 * added support for PHP 5.5 DateTimeInterface
882
883# 1.14.0 (2013-10-03)
884
885 * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
886 * added new operators: ends with, starts with, and matches
887 * fixed some compatibility issues with HHVM
888 * added a way to add custom escaping strategies
889 * fixed the C extension compilation on Windows
890 * fixed the batch filter when using a fill argument with an exact match of elements to batch
891 * fixed the filesystem loader cache when a template name exists in several namespaces
892 * fixed template_from_string when the template includes or extends other ones
893 * fixed a crash of the C extension on an edge case
894
895# 1.13.2 (2013-08-03)
896
897 * fixed the error line number for an error occurs in and embedded template
898 * fixed crashes of the C extension on some edge cases
899
900# 1.13.1 (2013-06-06)
901
902 * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
903 * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
904 * adjusted backtrace call to reduce memory usage when an error occurs
905 * added support for object instances as the second argument of the constant test
906 * fixed the include function when used in an assignment
907
908# 1.13.0 (2013-05-10)
909
910 * fixed getting a numeric-like item on a variable ('09' for instance)
911 * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
912   `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
913 * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
914 * changed ☃ to § in tests
915 * enforced usage of named arguments after positional ones
916
917# 1.12.3 (2013-04-08)
918
919 * fixed a security issue in the filesystem loader where it was possible to include a template one
920   level above the configured path
921 * fixed fatal error that should be an exception when adding a filter/function/test too late
922 * added a batch filter
923 * added support for encoding an array as query string in the url_encode filter
924
925# 1.12.2 (2013-02-09)
926
927 * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
928 * fixed globals when getGlobals is called early on
929 * added the first and last filter
930
931# 1.12.1 (2013-01-15)
932
933 * added support for object instances as the second argument of the constant function
934 * relaxed globals management to avoid a BC break
935 * added support for {{ some_string[:2] }}
936
937# 1.12.0 (2013-01-08)
938
939 * added verbatim as an alias for the raw tag to avoid confusion with the raw filter
940 * fixed registration of tests and functions as anonymous functions
941 * fixed globals management
942
943# 1.12.0-RC1 (2012-12-29)
944
945 * added an include function (does the same as the include tag but in a more flexible way)
946 * added the ability to use any PHP callable to define filters, functions, and tests
947 * added a syntax error when using a loop variable that is not defined
948 * added the ability to set default values for macro arguments
949 * added support for named arguments for filters, tests, and functions
950 * moved filters/functions/tests syntax errors to the parser
951 * added support for extended ternary operator syntaxes
952
953# 1.11.1 (2012-11-11)
954
955 * fixed debug info line numbering (was off by 2)
956 * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
957 * optimized variable access on PHP 5.4
958 * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
959
960# 1.11.0 (2012-11-07)
961
962 * fixed macro compilation when a variable name is a PHP reserved keyword
963 * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
964 * fixed bitwise operator precedences
965 * added the template_from_string function
966 * fixed default timezone usage for the date function
967 * optimized the way Twig exceptions are managed (to make them faster)
968 * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
969
970# 1.10.3 (2012-10-19)
971
972 * fixed wrong template location in some error messages
973 * reverted a BC break introduced in 1.10.2
974 * added a split filter
975
976# 1.10.2 (2012-10-15)
977
978 * fixed macro calls on PHP 5.4
979
980# 1.10.1 (2012-10-15)
981
982 * made a speed optimization to macro calls when imported via the "import" tag
983 * fixed C extension compilation on Windows
984 * fixed a segfault in the C extension when using DateTime objects
985
986# 1.10.0 (2012-09-28)
987
988 * extracted functional tests framework to make it reusable for third-party extensions
989 * added namespaced templates support in Twig_Loader_Filesystem
990 * added Twig_Loader_Filesystem::prependPath()
991 * fixed an error when a token parser pass a closure as a test to the subparse() method
992
993# 1.9.2 (2012-08-25)
994
995 * fixed the in operator for objects that contain circular references
996 * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
997
998# 1.9.1 (2012-07-22)
999
1000 * optimized macro calls when auto-escaping is on
1001 * fixed wrong parent class for Twig_Function_Node
1002 * made Twig_Loader_Chain more explicit about problems
1003
1004# 1.9.0 (2012-07-13)
1005
1006 * made the parsing independent of the template loaders
1007 * fixed exception trace when an error occurs when rendering a child template
1008 * added escaping strategies for CSS, URL, and HTML attributes
1009 * fixed nested embed tag calls
1010 * added the date_modify filter
1011
1012# 1.8.3 (2012-06-17)
1013
1014 * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
1015 * fixed escaping when a project defines a function named html or js
1016 * fixed chmod mode to apply the umask correctly
1017
1018# 1.8.2 (2012-05-30)
1019
1020 * added the abs filter
1021 * fixed a regression when using a number in template attributes
1022 * fixed compiler when mbstring.func_overload is set to 2
1023 * fixed DateTimeZone support in date filter
1024
1025# 1.8.1 (2012-05-17)
1026
1027 * fixed a regression when dealing with SimpleXMLElement instances in templates
1028 * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
1029 * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
1030
1031# 1.8.0 (2012-05-08)
1032
1033 * enforced interface when adding tests, filters, functions, and node visitors from extensions
1034 * fixed a side-effect of the date filter where the timezone might be changed
1035 * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
1036 * added a way to dynamically change the auto-escaping strategy according to the template "filename"
1037 * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
1038 * added an embed tag
1039
1040# 1.7.0 (2012-04-24)
1041
1042 * fixed a PHP warning when using CIFS
1043 * fixed template line number in some exceptions
1044 * added an iterable test
1045 * added an error when defining two blocks with the same name in a template
1046 * added the preserves_safety option for filters
1047 * fixed a PHP notice when trying to access a key on a non-object/array variable
1048 * enhanced error reporting when the template file is an instance of SplFileInfo
1049 * added Twig_Environment::mergeGlobals()
1050 * added compilation checks to avoid misuses of the sandbox tag
1051 * fixed filesystem loader freshness logic for high traffic websites
1052 * fixed random function when charset is null
1053
1054# 1.6.5 (2012-04-11)
1055
1056 * fixed a regression when a template only extends another one without defining any blocks
1057
1058# 1.6.4 (2012-04-02)
1059
1060 * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
1061 * fixed performance when compiling large files
1062 * optimized parent template creation when the template does not use dynamic inheritance
1063
1064# 1.6.3 (2012-03-22)
1065
1066 * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
1067 * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
1068 * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
1069
1070# 1.6.2 (2012-03-18)
1071
1072 * fixed sandbox mode when used with inheritance
1073 * added preserveKeys support for the slice filter
1074 * fixed the date filter when a DateTime instance is passed with a specific timezone
1075 * added a trim filter
1076
1077# 1.6.1 (2012-02-29)
1078
1079 * fixed Twig C extension
1080 * removed the creation of Twig_Markup instances when not needed
1081 * added a way to set the default global timezone for dates
1082 * fixed the slice filter on strings when the length is not specified
1083 * fixed the creation of the cache directory in case of a race condition
1084
1085# 1.6.0 (2012-02-04)
1086
1087 * fixed raw blocks when used with the whitespace trim option
1088 * made a speed optimization to macro calls when imported via the "from" tag
1089 * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
1090 * fixed the attribute function when passing arguments
1091 * added slice notation support for the [] operator (syntactic sugar for the slice operator)
1092 * added a slice filter
1093 * added string support for the reverse filter
1094 * fixed the empty test and the length filter for Twig_Markup instances
1095 * added a date function to ease date comparison
1096 * fixed unary operators precedence
1097 * added recursive parsing support in the parser
1098 * added string and integer handling for the random function
1099
1100# 1.5.1 (2012-01-05)
1101
1102 * fixed a regression when parsing strings
1103
1104# 1.5.0 (2012-01-04)
1105
1106 * added Traversable objects support for the join filter
1107
1108# 1.5.0-RC2 (2011-12-30)
1109
1110 * added a way to set the default global date interval format
1111 * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
1112 * refactored Twig_Template::display() to ease its extension
1113 * added a number_format filter
1114
1115# 1.5.0-RC1 (2011-12-26)
1116
1117 * removed the need to quote hash keys
1118 * allowed hash keys to be any expression
1119 * added a do tag
1120 * added a flush tag
1121 * added support for dynamically named filters and functions
1122 * added a dump function to help debugging templates
1123 * added a nl2br filter
1124 * added a random function
1125 * added a way to change the default format for the date filter
1126 * fixed the lexer when an operator ending with a letter ends a line
1127 * added string interpolation support
1128 * enhanced exceptions for unknown filters, functions, tests, and tags
1129
1130# 1.4.0 (2011-12-07)
1131
1132 * fixed lexer when using big numbers (> PHP_INT_MAX)
1133 * added missing preserveKeys argument to the reverse filter
1134 * fixed macros containing filter tag calls
1135
1136# 1.4.0-RC2 (2011-11-27)
1137
1138 * removed usage of Reflection in Twig_Template::getAttribute()
1139 * added a C extension that can optionally replace Twig_Template::getAttribute()
1140 * added negative timestamp support to the date filter
1141
1142# 1.4.0-RC1 (2011-11-20)
1143
1144 * optimized variable access when using PHP 5.4
1145 * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
1146 * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
1147 * added Twig_Function_Node to allow more complex functions to have their own Node class
1148 * added Twig_Filter_Node to allow more complex filters to have their own Node class
1149 * added Twig_Test_Node to allow more complex tests to have their own Node class
1150 * added a better error message when a template is empty but contain a BOM
1151 * fixed "in" operator for empty strings
1152 * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
1153 * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
1154 * added Twig_Environment::display()
1155 * made the escape filter smarter when the encoding is not supported by PHP
1156 * added a convert_encoding filter
1157 * moved all node manipulations outside the compile() Node method
1158 * made several speed optimizations
1159
1160# 1.3.0 (2011-10-08)
1161
1162no changes
1163
1164# 1.3.0-RC1 (2011-10-04)
1165
1166 * added an optimization for the parent() function
1167 * added cache reloading when auto_reload is true and an extension has been modified
1168 * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
1169 * allowed empty templates to be used as traits
1170 * added traits support for the "parent" function
1171
1172# 1.2.0 (2011-09-13)
1173
1174no changes
1175
1176# 1.2.0-RC1 (2011-09-10)
1177
1178 * enhanced the exception when a tag remains unclosed
1179 * added support for empty Countable objects for the "empty" test
1180 * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
1181 * added better support for encoding problems when escaping a string (available as of PHP 5.4)
1182 * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
1183 * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
1184 * added support for bitwise operators in expressions
1185 * added the "attribute" function to allow getting dynamic attributes on variables
1186 * added Twig_Loader_Chain
1187 * added Twig_Loader_Array::setTemplate()
1188 * added an optimization for the set tag when used to capture a large chunk of static text
1189 * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
1190 * removed the possibility to use the "extends" tag from a block
1191 * added "if" modifier support to "for" loops
1192
1193# 1.1.2 (2011-07-30)
1194
1195 * fixed json_encode filter on PHP 5.2
1196 * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
1197 * fixed inheritance when using conditional parents
1198 * fixed compilation of templates when the body of a child template is not empty
1199 * fixed output when a macro throws an exception
1200 * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
1201 * added PHPDoc for all Token parsers and Core extension functions
1202
1203# 1.1.1 (2011-07-17)
1204
1205 * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
1206 * made some performance improvement for some edge cases
1207
1208# 1.1.0 (2011-06-28)
1209
1210 * fixed json_encode filter
1211
1212# 1.1.0-RC3 (2011-06-24)
1213
1214 * fixed method case-sensitivity when using the sandbox mode
1215 * added timezone support for the date filter
1216 * fixed possible security problems with NUL bytes
1217
1218# 1.1.0-RC2 (2011-06-16)
1219
1220 * added an exception when the template passed to "use" is not a string
1221 * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
1222 * added {% line \d+ %} directive
1223
1224# 1.1.0-RC1 (2011-05-28)
1225
1226Flush your cache after upgrading.
1227
1228 * fixed date filter when using a timestamp
1229 * fixed the defined test for some cases
1230 * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
1231 * added support for horizontal reuse of template blocks (see docs for more information)
1232 * added whitespace control modifier to all tags (see docs for more information)
1233 * added null as an alias for none (the null test is also an alias for the none test now)
1234 * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
1235 * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
1236 * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
1237
1238# 1.0.0 (2011-03-27)
1239
1240 * fixed output when using mbstring
1241 * fixed duplicate call of methods when using the sandbox
1242 * made the charset configurable for the escape filter
1243
1244# 1.0.0-RC2 (2011-02-21)
1245
1246 * changed the way {% set %} works when capturing (the content is now marked as safe)
1247 * added support for macro name in the endmacro tag
1248 * make Twig_Error compatible with PHP 5.3.0 >
1249 * fixed an infinite loop on some Windows configurations
1250 * fixed the "length" filter for numbers
1251 * fixed Template::getAttribute() as properties in PHP are case sensitive
1252 * removed coupling between Twig_Node and Twig_Template
1253 * fixed the ternary operator precedence rule
1254
1255# 1.0.0-RC1 (2011-01-09)
1256
1257Backward incompatibilities:
1258
1259 * the "items" filter, which has been deprecated for quite a long time now, has been removed
1260 * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
1261 * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
1262 * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
1263 * the "for" tag does not support "joined by" anymore
1264 * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
1265 * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
1266 * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
1267 * removed the grammar and simple token parser (moved to the Twig Extensions repository)
1268
1269Changes:
1270
1271 * added "needs_context" option for filters and functions (the context is then passed as a first argument)
1272 * added global variables support
1273 * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
1274 * added the "from" tag to import macros as functions
1275 * added support for functions (a function is just syntactic sugar for a getAttribute() call)
1276 * made macros callable when sandbox mode is enabled
1277 * added an exception when a macro uses a reserved name
1278 * the "default" filter now uses the "empty" test instead of just checking for null
1279 * added the "empty" test
1280
1281# 0.9.10 (2010-12-16)
1282
1283Backward incompatibilities:
1284
1285 * The Escaper extension is enabled by default, which means that all displayed
1286   variables are now automatically escaped. You can revert to the previous
1287   behavior by removing the extension via $env->removeExtension('escaper')
1288   or just set the 'autoescape' option to 'false'.
1289 * removed the "without loop" attribute for the "for" tag (not needed anymore
1290   as the Optimizer take care of that for most cases)
1291 * arrays and hashes have now a different syntax
1292     * arrays keep the same syntax with square brackets: [1, 2]
1293     * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
1294     * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
1295 * the i18n extension is now part of the Twig Extensions repository
1296
1297Changes:
1298
1299 * added the merge filter
1300 * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
1301 * fixed usage of operators as method names (like is, in, and not)
1302 * changed the order of execution for node visitors
1303 * fixed default() filter behavior when used with strict_variables set to on
1304 * fixed filesystem loader compatibility with PHAR files
1305 * enhanced error messages when an unexpected token is parsed in an expression
1306 * fixed filename not being added to syntax error messages
1307 * added the autoescape option to enable/disable autoescaping
1308 * removed the newline after a comment (mimics PHP behavior)
1309 * added a syntax error exception when parent block is used on a template that does not extend another one
1310 * made the Escaper extension enabled by default
1311 * fixed sandbox extension when used with auto output escaping
1312 * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
1313 * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
1314 * added priority to node visitors
1315
1316# 0.9.9 (2010-11-28)
1317
1318Backward incompatibilities:
1319 * the self special variable has been renamed to _self
1320 * the odd and even filters are now tests:
1321     {{ foo|odd }} must now be written {{ foo is odd }}
1322 * the "safe" filter has been renamed to "raw"
1323 * in Node classes,
1324        sub-nodes are now accessed via getNode() (instead of property access)
1325        attributes via getAttribute() (instead of array access)
1326 * the urlencode filter had been renamed to url_encode
1327 * the include tag now merges the passed variables with the current context by default
1328   (the old behavior is still possible by adding the "only" keyword)
1329 * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
1330 * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
1331 * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
1332
1333Changes:
1334 * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
1335 * changed trans tag to accept any variable for the plural count
1336 * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
1337 * added the ** (power) operator
1338 * changed the algorithm used for parsing expressions
1339 * added the spaceless tag
1340 * removed trim_blocks option
1341 * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
1342 * changed all exceptions to extend Twig_Error
1343 * fixed unary expressions ({{ not(1 or 0) }})
1344 * fixed child templates (with an extend tag) that uses one or more imports
1345 * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
1346 * escaping has been rewritten
1347 * the implementation of template inheritance has been rewritten
1348   (blocks can now be called individually and still work with inheritance)
1349 * fixed error handling for if tag when a syntax error occurs within a subparse process
1350 * added a way to implement custom logic for resolving token parsers given a tag name
1351 * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
1352 * added the following filers: "constant", "trans", "replace", "json_encode"
1353 * added a "constant" test
1354 * fixed objects with __toString() not being autoescaped
1355 * fixed subscript expressions when calling __call() (methods now keep the case)
1356 * added "test" feature (accessible via the "is" operator)
1357 * removed the debug tag (should be done in an extension)
1358 * fixed trans tag when no vars are used in plural form
1359 * fixed race condition when writing template cache
1360 * added the special _charset variable to reference the current charset
1361 * added the special _context variable to reference the current context
1362 * renamed self to _self (to avoid conflict)
1363 * fixed Twig_Template::getAttribute() for protected properties
1364
1365# 0.9.8 (2010-06-28)
1366
1367Backward incompatibilities:
1368 * the trans tag plural count is now attached to the plural tag:
1369    old: `{% trans count %}...{% plural %}...{% endtrans %}`
1370    new: `{% trans %}...{% plural count %}...{% endtrans %}`
1371
1372 * added a way to translate strings coming from a variable ({% trans var %})
1373 * fixed trans tag when used with the Escaper extension
1374 * fixed default cache umask
1375 * removed Twig_Template instances from the debug tag output
1376 * fixed objects with __isset() defined
1377 * fixed set tag when used with a capture
1378 * fixed type hinting for Twig_Environment::addFilter() method
1379
1380# 0.9.7 (2010-06-12)
1381
1382Backward incompatibilities:
1383 * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
1384 * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
1385 * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
1386
1387 * added self as a special variable that refers to the current template (useful for importing macros from the current template)
1388 * added Twig_Template instance support to the include tag
1389 * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
1390 * added a grammar sub-framework to ease the creation of custom tags
1391 * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
1392 * removed the Twig_Resource::resolveMissingFilter() method
1393 * fixed the filter tag which did not apply filtering to included files
1394 * added a bunch of unit tests
1395 * added a bunch of phpdoc
1396 * added a sandbox tag in the sandbox extension
1397 * changed the date filter to support any date format supported by DateTime
1398 * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
1399 * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
1400 * changed the cache option to only accepts an explicit path to a cache directory or false
1401 * added a way to add token parsers, filters, and visitors without creating an extension
1402 * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
1403 * changed the generated code to match the new coding standards
1404 * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
1405 * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
1406
1407# 0.9.6 (2010-05-12)
1408
1409 * fixed variables defined outside a loop and for which the value changes in a for loop
1410 * fixed the test suite for PHP 5.2 and older versions of PHPUnit
1411 * added support for __call() in expression resolution
1412 * fixed node visiting for macros (macros are now visited by visitors as any other node)
1413 * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
1414 * added the cycle filter
1415 * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
1416 * added a long-syntax for the set tag ({% set foo %}...{% endset %})
1417 * unit tests are now powered by PHPUnit
1418 * added support for gettext via the `i18n` extension
1419 * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
1420 * added a more useful exception if an if tag is not closed properly
1421 * added support for escaping strategy in the autoescape tag
1422 * fixed lexer when a template has a big chunk of text between/in a block
1423
1424# 0.9.5 (2010-01-20)
1425
1426As for any new release, don't forget to remove all cached templates after
1427upgrading.
1428
1429If you have defined custom filters, you MUST upgrade them for this release. To
1430upgrade, replace "array" with "new Twig_Filter_Function", and replace the
1431environment constant by the "needs_environment" option:
1432
1433  // before
1434  'even'   => array('twig_is_even_filter', false),
1435  'escape' => array('twig_escape_filter', true),
1436
1437  // after
1438  'even'   => new Twig_Filter_Function('twig_is_even_filter'),
1439  'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
1440
1441If you have created NodeTransformer classes, you will need to upgrade them to
1442the new interface (please note that the interface is not yet considered
1443stable).
1444
1445 * fixed list nodes that did not extend the Twig_NodeListInterface
1446 * added the "without loop" option to the for tag (it disables the generation of the loop variable)
1447 * refactored node transformers to node visitors
1448 * fixed automatic-escaping for blocks
1449 * added a way to specify variables to pass to an included template
1450 * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
1451 * improved the filter system to allow object methods to be used as filters
1452 * changed the Array and String loaders to actually make use of the cache mechanism
1453 * included the default filter function definitions in the extension class files directly (Core, Escaper)
1454 * added the // operator (like the floor() PHP function)
1455 * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
1456 * added the in operator (as a syntactic sugar for the in filter)
1457 * added the following filters in the Core extension: in, range
1458 * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
1459 * enhanced some error messages to provide better feedback in case of parsing errors
1460
1461# 0.9.4 (2009-12-02)
1462
1463If you have custom loaders, you MUST upgrade them for this release: The
1464Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
1465been changed (see the source code for more information or the documentation).
1466
1467 * added support for DateTime instances for the date filter
1468 * fixed loop.last when the array only has one item
1469 * made it possible to insert newlines in tag and variable blocks
1470 * fixed a bug when a literal '\n' were present in a template text
1471 * fixed bug when the filename of a template contains */
1472 * refactored loaders
1473
1474# 0.9.3 (2009-11-11)
1475
1476This release is NOT backward compatible with the previous releases.
1477
1478  The loaders do not take the cache and autoReload arguments anymore. Instead,
1479  the Twig_Environment class has two new options: cache and auto_reload.
1480  Upgrading your code means changing this kind of code:
1481
1482      $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
1483      $twig = new Twig_Environment($loader);
1484
1485  to something like this:
1486
1487      $loader = new Twig_Loader_Filesystem('/path/to/templates');
1488      $twig = new Twig_Environment($loader, array(
1489        'cache' => '/path/to/compilation_cache',
1490        'auto_reload' => true,
1491      ));
1492
1493 * deprecated the "items" filter as it is not needed anymore
1494 * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
1495 * optimized template loading speed
1496 * removed output when an error occurs in a template and render() is used
1497 * made major speed improvements for loops (up to 300% on even the smallest loops)
1498 * added properties as part of the sandbox mode
1499 * added public properties support (obj.item can now be the item property on the obj object)
1500 * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
1501 * fixed bug when \ was used in HTML
1502
1503# 0.9.2 (2009-10-29)
1504
1505 * made some speed optimizations
1506 * changed the cache extension to .php
1507 * added a js escaping strategy
1508 * added support for short block tag
1509 * changed the filter tag to allow chained filters
1510 * made lexer more flexible as you can now change the default delimiters
1511 * added set tag
1512 * changed default directory permission when cache dir does not exist (more secure)
1513 * added macro support
1514 * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
1515 * made Twig_Autoloader::autoload() a static method
1516 * avoid writing template file if an error occurs
1517 * added $ escaping when outputting raw strings
1518 * enhanced some error messages to ease debugging
1519 * fixed empty cache files when the template contains an error
1520
1521# 0.9.1 (2009-10-14)
1522
1523  * fixed a bug in PHP 5.2.6
1524  * fixed numbers with one than one decimal
1525  * added support for method calls with arguments ({{ foo.bar('a', 43) }})
1526  * made small speed optimizations
1527  * made minor tweaks to allow better extensibility and flexibility
1528
1529# 0.9.0 (2009-10-12)
1530
1531 * Initial release
1532