# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [5.5.2] - 2025-08-26 - Fixed escaping of array/object keys in debug_print_var ## [5.5.1] - 2025-05-19 - Fix missing support for loading modifiercompilers from plugin dir in BCPluginsAdapter [#1132](https://github.com/smarty-php/smarty/pull/1132) ## [5.5.0] - 2025-05-03 - Support trailing comma in array [#1013](https://github.com/smarty-php/smarty/issues/1013) ## [5.4.5] - 2025-04-15 - Fixed deprecation notice in StringEval in PHP8.4 [#1119](https://github.com/smarty-php/smarty/issues/1119) ## [5.4.4] - 2025-04-13 - Fix syntax error occurring when registering a function plugin that ends with the string 'close' [#1122](https://github.com/smarty-php/smarty/issues/1122) - Replace SMARTY_VERSION constant with $smarty.version in debug.tpl [#1073](https://github.com/smarty-php/smarty/issues/1073) ## [5.4.3] - 2024-12-23 - Fix PHP backtraces by qualifying/replacing `call_user_func_array` calls [#1074](https://github.com/smarty-php/smarty/issues/1074) ## [5.4.2] - 2024-11-20 - Support the deprecations introduced in PHP 8.4 and added tests for PHP 8.4 [#1043](https://github.com/smarty-php/smarty/pull/1043) ## [5.4.1] - 2024-08-29 - Enable (and fix) unit tests for Windows [#1046](https://github.com/smarty-php/smarty/pull/1046) - Fix the use of "extends:" to define the inheritance tree on Windows [#1018](https://github.com/smarty-php/smarty/issues/1018) ## [5.4.0] - 2024-08-14 - Fixing forced OpCache invalidation on every template include, which is resulting in fast raising wasted OpCache memory [#1007](https://github.com/smarty-php/smarty/issues/1007) - Improvement of auto-escaping [#1030](https://github.com/smarty-php/smarty/pull/1030) ## [5.3.1] - 2024-06-16 - Fixed error when using section with nocache [#1034](https://github.com/smarty-php/smarty/issues/1034) ## [5.3.0] - 2024-05-30 - Fix warning when calling hasVariable for an undefined variable [#977](https://github.com/smarty-php/smarty/issues/977) - Added `$smarty->prependTemplateDir()` method [#1022](https://github.com/smarty-php/smarty/issues/1022) ## [5.2.0] - 2024-05-28 - Fixed a code injection vulnerability in extends-tag. This addresses CVE-2024-35226. - Added `$smarty->setCacheModifiedCheck()` setter for cache_modified_check - Added a PSR-4 loading script to allow Smarty to be used without Composer [#1017](https://github.com/smarty-php/smarty/pull/1017) ## [5.1.0] - 2024-04-22 - Prevent deprecation notices during compilation in PHP8.3 [#996](https://github.com/smarty-php/smarty/issues/996) - Fix that getTemplateVars would return an array of objects instead of the assigned variables values [#994](https://github.com/smarty-php/smarty/issues/994) - Fix Smarty::assign() not returning $this when called with an array as first parameter [#972](https://github.com/smarty-php/smarty/pull/972) - Documented support for `{if $element is in $array}` syntax [#937](https://github.com/smarty-php/smarty/issues/937) - Added support for `{if $element is not in $array}` syntax [#937](https://github.com/smarty-php/smarty/issues/937) - Using stream variables in templates now throws a deprecation notice [#933](https://github.com/smarty-php/smarty/pull/933) - Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity) [#918](https://github.com/smarty-php/smarty/pull/918) - Fix invalid classnames in Runtime code for foreach [#1000](https://github.com/smarty-php/smarty/issues/1000) ## [5.0.2] - 2024-03-28 - Fix Smarty::assign() not returning $this when called with an array as first parameter [#972](https://github.com/smarty-php/smarty/pull/972) ## [5.0.1] - 2024-03-27 - Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966) ## [5.0.0] - 2024-03-25 - Fixed that scoped variables would overwrite parent scope [#952](https://github.com/smarty-php/smarty/issues/952) - Removed publicly accessible `$tpl->_var_stack` variable ### Fixed - Too many shorthand attributes error when using a modifier as a function with more than 3 parameters in an expression [#949](https://github.com/smarty-php/smarty/issues/949) ### Removed - Dropped support for undocumented `{time()}` added in v5.0.0 since we already have the documented `{$smarty.now}` ## [5.0.0-rc3] - 2024-02-26 ### Added - PHP8.3 support [#925](https://github.com/smarty-php/smarty/issues/925) - Backlink to GitHub in docs - Explain how to do escaping and set-up auto-escaping in docs [#865](https://github.com/smarty-php/smarty/issues/865) - Link to variable scope page in the documentation for the assign tag [#878](https://github.com/smarty-php/smarty/issues/878) - Add support for implode, substr and json_encode as modifiers/functions in templates [#939](https://github.com/smarty-php/smarty/issues/939) - Add template path to CompilerException to enable rich debug features [#935](https://github.com/smarty-php/smarty/issues/935) ### Fixed - The {debug} tag was broken in v5 [#922](https://github.com/smarty-php/smarty/issues/922) - Documentation on `{if $x is even by $y}` syntax - Fix incorrect compilation of expressions when escape_html=true [#930](https://github.com/smarty-php/smarty/pull/930) ## [5.0.0-rc2] - 2023-11-11 ### Fixed - Registered output filters wouldn't run [#899](https://github.com/smarty-php/smarty/issues/899) - Use of negative numbers in {math} equations [#895](https://github.com/smarty-php/smarty/issues/895) - Do not auto-html-escape custom function results [#906](https://github.com/smarty-php/smarty/issues/906) - Fix case-sensitive tag names [#907](https://github.com/smarty-php/smarty/issues/907) ### Removed - Removed `$smarty->registered_filters` array ## [5.0.0-rc1] - 2023-08-08 ### Added - Added support for PHP8.2 - Added a new way to extend Smarty functionality using `Smarty::addExtension()` or `Smarty::setExtensions()`. Please see the docs for more information. - Custom tags can accept positional parameters, so you can write a block compiler that support this: `{trans "Jack" "dull boy"}All work and no play makes %s a %s.{/trans}` [#164](https://github.com/smarty-php/smarty/issues/164) - Full support for ternary operator: `{$test ? $a : $b}` and `{$var ?: $value_if_falsy}` [#881](https://github.com/smarty-php/smarty/issues/881) - Full support for null coalescing operator: `{$var ?? $value_if_null}` [#882](https://github.com/smarty-php/smarty/issues/882) ### Changed - All Smarty code is now in the \Smarty namespace. For simple use-cases, you only need to add `use \Smarty\Smarty;` to your script and everything will work. If you extend Smarty or use Smarty plug-ins, please review your code to see if they assume specific class or method names. E.g.: `Smarty_Internal_Template` is now `\Smarty\Template\`, `SmartyException` is now `\Smarty\Exception`. - Template variable scope bubbling has been simplified and made more consistent. The global scope now equals the Smarty scope in order to avoid global state side effects. Please read the documentation for more details. - Lexers and Parsers PHP files are reliably generated from sources (.y and .plex) using the make file - Smarty now always runs in multibyte mode, using `symfony/polyfill-mbstring` if required. Please use the multibyte extension for optimal performance. - Smarty no longer calls `mb_internal_encoding()` and doesn't check for deprecated `mbstring.func_overload` ini directive [#480](https://github.com/smarty-php/smarty/issues/480) - Generated `