1# 2.14.12 (2022-03-25) 2 3 * Fix custom escapers when using multiple Twig environments 4 * Do not reuse internally generated variable names during parsing 5 6# 2.14.11 (2022-02-04) 7 8 * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter 9 * Fix deprecation notice on `round` 10 * Fix call to deprecated `convertToHtml` method 11 12# 2.14.10 (2022-01-03) 13 14 * Allow more null arguments when Twig expects a string (for better 8.1 support) 15 16# 2.14.9 (2022-01-03) 17 18* Allow null when Twig expects a string (for better 8.1 support) 19* Add support for PHP 7.1 back 20* Make some performance optimizations 21* Allow Symfony translation contract v3+ 22 23# 2.14.8 (2021-11-25) 24 25 * Bump minimum supported Symfony component versions 26 * Fix a deprecated message 27 28# 2.14.7 (2021-09-17) 29 30 * Allow Symfony 6 31 * Improve compatibility with PHP 8.1 32 * Explicitly specify the encoding for mb_ord in JS escaper 33 34# 2.14.6 (2021-05-16) 35 36 * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" 37 38# 2.14.5 (2021-05-12) 39 40 * Fix PHP 8.1 compatibility 41 * Throw a proper exception when a template name is an absolute path (as it has never been supported) 42 43# 2.14.4 (2021-03-10) 44 45 * Add the slug filter 46 47# 2.14.3 (2021-01-05) 48 49 * Fix extra bundle compat with older versions of Symfony 50 51# 2.14.2 (2021-01-05) 52 53 * Fix "odd" not working for negative numbers 54 55# 2.14.1 (2020-10-27) 56 57* Fix "include(template_from_string())" 58 59# 2.14.0 (2020-10-21) 60 61 * Fix sandbox support when using "include(template_from_string())" 62 * Make round brackets optional for one argument tests like "same as" or "divisible by" 63 * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } 64 * Drop PHP 7.1 support 65 66# 2.13.1 (2020-08-05) 67 68 * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag 69 * Fix a regression when not using a space before an operator 70 * Restrict callables to closures in filters 71 * Allow trailing commas in argument lists (in calls as well as definitions) 72 73# 2.13.0 (2020-07-05) 74 75 * Fix options not taken into account when using "Michelf\MarkdownExtra" 76 * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument 77 * Drop support for PHP 7.0 78 * Throw exception in case non-Traversable data is passed to "filter" 79 * Fix context optimization on PHP 7.4 80 * Fix PHP 8 compatibility 81 * Fix ambiguous syntax parsing 82 83# 2.12.5 (2020-02-11) 84 85 * Add a check to ensure that iconv() is defined 86 87# 2.12.4 (2020-02-11) 88 89 * Avoid exceptions when an intl resource is not found 90 * Fix implementation of case-insensitivity for method names 91 92# 2.12.3 (2019-12-28) 93 94 * fixed Symfony 5.0 support for the HTML extra extension 95 * fixed number formatter in Intl extra extension when using a formatter prototype 96 97# 2.12.2 (2019-11-11) 98 99 * added supported for exponential numbers 100 101# 2.12.1 (2019-10-17) 102 103 * added the String extension in the "extra" repositories: "u" filter 104 105# 2.12.0 (2019-10-05) 106 107 * added the spaceship operator ("<=>"), useful when using an arrow function in the "sort" filter 108 * added support for an "arrow" function on the "sort" filter 109 * added the CssInliner extension in the "extra" repositories: "inline_css" 110 filter 111 * added the Inky extension in the "extra" repositories: "inky_to_html" filter 112 * added Intl extension in the "extra" repositories: "country_name", 113 "currency_name", "currency_symbol", "language_name", "locale_name", 114 "timezone_name", "format_currency", "format_number", 115 "format_*_number", "format_datetime", "format_date", and "format_time" 116 filters, and the "country_timezones" function 117 * added the Markdown extension in the "extra" repositories: "markdown_to_html", 118 and "html_to_markdown" filters 119 * added the HtmlExtension extension in the "extra" repositories: "date_uri" 120 filter, and "html_classes" function 121 * optimized "block('foo') ?? 'bar'" 122 * fixed the empty test on Traversable instances 123 * fixed array_key_exists() on objects 124 * fixed cache when opcache is installed but disabled 125 * fixed using macros in arrow functions 126 * fixed split filter on edge case 127 128# 2.11.3 (2019-06-18) 129 130 * display partial output (PHP buffer) when an error occurs in debug mode 131 * fixed the filter filter (allow the result to be used several times) 132 * fixed macro auto-import when a template contains only macros 133 134# 2.11.2 (2019-06-05) 135 136 * fixed macro auto-import 137 138# 2.11.1 (2019-06-04) 139 140 * added support for "Twig\Markup" instances in the "in" test (again) 141 * allowed string operators as variables names in assignments 142 * fixed support for macros defined in parent templates 143 144# 2.11.0 (2019-05-31) 145 146 * added the possibility to register classes/interfaces as being safe for the escaper ("EscaperExtension::addSafeClass()") 147 * deprecated CoreExtension::setEscaper() and CoreExtension::getEscapers() in favor of the same methods on EscaperExtension 148 * macros are now auto-imported in the template they are defined (under the ``_self`` variable) 149 * added support for macros on "is defined" tests 150 * fixed macros "import" when using the same name in the parent and child templates 151 * fixed recursive macros 152 * macros imported "globally" in a template are now available in macros without re-importing them 153 * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) 154 * fixed a PHP fatal error when calling a macro imported in a block in a nested block 155 * fixed a PHP fatal error when calling a macro imported in the template in another macro 156 * fixed wrong error message on "import" and "from" 157 158# 2.10.0 (2019-05-14) 159 160 * deprecated "if" conditions on "for" tags 161 * added "filter", "map", and "reduce" filters (and support for arrow functions) 162 * fixed partial output leak when a PHP fatal error occurs 163 * optimized context access on PHP 7.4 164 165# 2.9.0 (2019-04-28) 166 167 * deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode() 168 * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) 169 * deprecated the "filter" tag (use the "apply" tag instead) 170 * added the "apply" tag as a replacement for the "filter" tag 171 * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) 172 * added support for "Twig\Markup" instances in the "in" test 173 * fixed "import" when macros are stored in a template string 174 * fixed Lexer when using custom options containing the # char 175 * added template line number to twig_get_attribute() 176 177# 2.8.1 (2019-04-16) 178 179 * fixed EscaperNodeVisitor 180 * deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes 181 * deprecated Node::setTemplateName() in favor of Node::setSourceContext() 182 183# 2.8.0 (2019-04-16) 184 185 * added Traversable support for the length filter 186 * fixed some wrong location in error messages 187 * made exception creation faster 188 * made escaping on ternary expressions (?: and ??) more fine-grained 189 * added the possibility to give a nice name to string templates (template_from_string function) 190 * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) 191 * fixed "include" with "ignore missing" when an error loading occurs in the included template 192 * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) 193 * added the "column" filter 194 195# 2.7.4 (2019-03-23) 196 197 * fixed variadic support 198 * fixed CheckToStringNode implementation (broken when a function/filter is variadic) 199 200# 2.7.3 (2019-03-21) 201 202 * fixed the spaceless filter so that it behaves like the spaceless tag 203 * fixed BC break on Environment::resolveTemplate() 204 * allowed Traversable objects to be used in the "with" tag 205 * allowed Traversable objects to be used in the "with" tag 206 * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags 207 208# 2.7.2 (2019-03-12) 209 210 * added TemplateWrapper::getTemplateName() 211 212# 2.7.1 (2019-03-12) 213 214 * fixed class aliases 215 216# 2.7.0 (2019-03-12) 217 218 * fixed sandbox security issue (under some circumstances, calling the 219 __toString() method on an object was possible even if not allowed by the 220 security policy) 221 * fixed batch filter clobbers array keys when fill parameter is used 222 * added preserveKeys support for the batch filter 223 * fixed "embed" support when used from "template_from_string" 224 * deprecated passing a Twig\Template to Twig\Environment::load()/Twig\Environment::resolveTemplate() 225 * added the possibility to pass a TemplateWrapper to Twig\Environment::load() 226 * marked Twig\Environment::getTemplateClass() as internal (implementation detail) 227 * improved the performance of the sandbox 228 * deprecated the spaceless tag 229 * added a spaceless filter 230 * added max value to the "random" function 231 * deprecated Twig\Extension\InitRuntimeInterface 232 * deprecated Twig\Loader\ExistsLoaderInterface 233 * deprecated PSR-0 classes in favor of namespaced ones 234 * made namespace classes the default classes (PSR-0 ones are aliases now) 235 * added Twig\Loader\ChainLoader::getLoaders() 236 * removed duplicated directory separator in FilesystemLoader 237 * deprecated the "base_template_class" option on Twig\Environment 238 * deprecated the Twig\Environment::getBaseTemplateClass() and 239 Twig\Environment::setBaseTemplateClass() methods 240 * changed internal code to use the namespaced classes as much as possible 241 * deprecated Twig_Parser::isReservedMacroName() 242 243# 2.6.2 (2019-01-14) 244 245 * fixed regression (key exists check for non ArrayObject objects) 246 247# 2.6.1 (2019-01-14) 248 249 * fixed ArrayObject access with a null value 250 * fixed embedded templates starting with a BOM 251 * fixed using a Twig_TemplateWrapper instance as an argument to extends 252 * fixed error location when calling an undefined block 253 * deprecated passing a string as a source on Twig_Error 254 * switched generated code to use the PHP short array notation 255 * fixed float representation in compiled templates 256 * added a second argument to the join filter (last separator configuration) 257 258# 2.6.0 (2018-12-16) 259 260 * made sure twig_include returns a string 261 * fixed multi-byte UFT-8 in escape('html_attr') 262 * added the "deprecated" tag 263 * added support for dynamically named tests 264 * fixed GlobalsInterface extended class 265 * fixed filesystem loader throwing an exception instead of returning false 266 267# 2.5.0 (2018-07-13) 268 269 * deprecated using the spaceless tag at the root level of a child template (noop anyway) 270 * deprecated the possibility to define a block in a non-capturing block in a child template 271 * added the Symfony ctype polyfill as a dependency 272 * fixed reporting the proper location for errors compiled in templates 273 * fixed the error handling for the optimized extension-based function calls 274 * ensured that syntax errors are triggered with the right line 275 * "js" filter now produces valid JSON 276 277# 2.4.8 (2018-04-02) 278 279 * fixed a regression when using the "default" filter or the "defined" test on non-existing arrays 280 281# 2.4.7 (2018-03-20) 282 283 * optimized runtime performance 284 * optimized parser performance by inlining the constant values 285 * fixed block names unicity 286 * fixed counting children of SimpleXMLElement objects 287 * added missing else clause to avoid infinite loops 288 * fixed .. (range operator) in sandbox policy 289 290# 2.4.6 (2018-03-03) 291 292 * fixed a regression in the way the profiler is registered in templates 293 294# 2.4.5 (2018-03-02) 295 296 * optimized the performance of calling an extension method at runtime 297 * optimized the performance of the dot operator for array and method calls 298 * added an exception when using "===" instead of "same as" 299 * fixed possible array to string conversion concealing actual error 300 * made variable names deterministic in compiled templates 301 * fixed length filter when passing an instance of IteratorAggregate 302 * fixed Environment::resolveTemplate to accept instances of TemplateWrapper 303 304# 2.4.4 (2017-09-27) 305 306 * added Twig_Profiler_Profile::reset() 307 * fixed use TokenParser to return an empty Node 308 * added RuntimeExtensionInterface 309 * added circular reference detection when loading templates 310 * added support for runtime loaders in IntegrationTestCase 311 * fixed deprecation when using Twig_Profiler_Dumper_Html 312 * removed @final from Twig_Profiler_Dumper_Text 313 314# 2.4.3 (2017-06-07) 315 316 * fixed namespaces introduction 317 318# 2.4.2 (2017-06-05) 319 320 * fixed namespaces introduction 321 322# 2.4.1 (2017-06-05) 323 324 * fixed namespaces introduction 325 326# 2.4.0 (2017-06-05) 327 328 * added support for PHPUnit 6 when testing extensions 329 * fixed PHP 7.2 compatibility 330 * fixed template name generation in Twig_Environment::createTemplate() 331 * removed final tag on Twig_TokenParser_Include 332 * dropped HHVM support 333 * added namespaced aliases for all (non-deprecated) classes and interfaces 334 * marked Twig_Filter, Twig_Function, Twig_Test, Twig_Node_Module and Twig_Profiler_Profile as final via the @final annotation 335 336# 2.3.2 (2017-04-20) 337 338 * fixed edge case in the method cache for Twig attributes 339 340# 2.3.1 (2017-04-18) 341 342 * fixed the empty() test 343 344# 2.3.0 (2017-03-22) 345 346 * fixed a race condition handling when writing cache files 347 * "length" filter now returns string length when applied to an object that does 348 not implement \Countable but provides __toString() 349 * "empty" test will now consider the return value of the __toString() method for 350 objects implement __toString() but not \Countable 351 * fixed JS escaping for unicode characters with higher code points 352 * added error message when calling `parent()` in a block that doesn't exist in the parent template 353 354# 2.2.0 (2017-02-26) 355 356 * added a PSR-11 compatible runtime loader 357 * added `side` argument to `trim` to allow left or right trimming only. 358 359# 2.1.0 (2017-01-11) 360 361 * fixed twig_get_attribute() 362 * added Twig_NodeCaptureInterface for nodes that capture all output 363 364# 2.0.0 (2017-01-05) 365 366 * removed the C extension 367 * moved Twig_Environment::getAttribute() to twig_get_attribute() 368 * removed Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() 369 * removed Twig_Compiler::getFilename() 370 * added hasser support in Twig_Template::getAttribute() 371 * sped up the json_encode filter 372 * removed reserved macro names; all names can be used as macro 373 * removed Twig_Template::getEnvironment() 374 * changed _self variable to return the current template name 375 * made the loader a required argument of Twig_Environment constructor 376 * removed Twig_Environment::clearTemplateCache() 377 * removed Twig_Autoloader (use Composer instead) 378 * removed `true` as an equivalent to `html` for the auto-escaping strategy 379 * removed pre-1.8 autoescape tag syntax 380 * dropped support for PHP 5.x 381 * removed the ability to register a global variable after the runtime or the extensions have been initialized 382 * improved the performance of the filesystem loader 383 * removed features that were deprecated in 1.x 384