diff options
Diffstat (limited to 'vendor/smarty')
13 files changed, 100 insertions, 7 deletions
diff --git a/vendor/smarty/smarty/CHANGELOG.md b/vendor/smarty/smarty/CHANGELOG.md index 04be00ec8..69d41e7aa 100644 --- a/vendor/smarty/smarty/CHANGELOG.md +++ b/vendor/smarty/smarty/CHANGELOG.md @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.4.1] - 2024-02-26 +- Fixed internal release-tooling + +## [4.4.0] - 2024-02-26 +### Changed +- Using the `|implode`, `|json_encode` and `|substr` modifiers does not generate a deprecation warning anymore as they will continue to be supported in v5 [#939](https://github.com/smarty-php/smarty/issues/939) + +### Added +- PHP8.3 support [#925](https://github.com/smarty-php/smarty/issues/925) + +### Fixed +- Incorrect compilation of expressions when escape_html=true [#930](https://github.com/smarty-php/smarty/pull/930) + ## [4.3.4] - 2023-09-14 ## [4.3.3] - 2023-09-14 diff --git a/vendor/smarty/smarty/README.md b/vendor/smarty/smarty/README.md index 0ef3cfab6..9b8706d45 100644 --- a/vendor/smarty/smarty/README.md +++ b/vendor/smarty/smarty/README.md @@ -7,7 +7,7 @@ Smarty is a template engine for PHP, facilitating the separation of presentation Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it. ## Requirements -Smarty can be run with PHP 7.1 to PHP 8.2. +Smarty can be run with PHP 7.1 to PHP 8.3. ## Installation Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/). diff --git a/vendor/smarty/smarty/changelog/.gitkeep b/vendor/smarty/smarty/changelog/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/vendor/smarty/smarty/changelog/.gitkeep diff --git a/vendor/smarty/smarty/docs/getting-started.md b/vendor/smarty/smarty/docs/getting-started.md index 2ffbbd11b..f549e50e7 100644 --- a/vendor/smarty/smarty/docs/getting-started.md +++ b/vendor/smarty/smarty/docs/getting-started.md @@ -1,7 +1,7 @@ # Getting started ## Requirements -Smarty can be run with PHP 7.1 to PHP 8.2. +Smarty can be run with PHP 7.1 to PHP 8.3. ## Installation Smarty can be installed with [Composer](https://getcomposer.org/). diff --git a/vendor/smarty/smarty/docs/upgrading.md b/vendor/smarty/smarty/docs/upgrading.md new file mode 100644 index 000000000..667a1422c --- /dev/null +++ b/vendor/smarty/smarty/docs/upgrading.md @@ -0,0 +1,38 @@ +# Upgrading from an older version + +## Upgrading from v3 to v4 + +Smarty 4 is mostly identical to Smarty 3. Most notably, it adds support for PHP8 and drops support for PHP7.0 and below. +Additionally, some deprecated features that have long been discouraged have been dropped from the language. + +### Muting PHP8 warnings +If you simultaneously upgrade Smarty to v4 van PHP to v8, you may notice your error logs filling up with warnings about undefined or null template vars +due to a change in how PHP handles these. This may be helpful to spot errors, but if you find this annoying, you can use +`$smarty->muteUndefinedOrNullWarnings()` to make Smarty convert these warnings into notices. + +### ASP tags +You can no longer user ASP-style tags like `<% %>` and `<%= %>` in your templates. +Replace them with `{...}` tags. + +### SmartyBC +Check your codebase for `SmartyBC`. +We have dropped deprecated API calls that where only accessible through the SmartyBC class. + +### No more embedded PHP +We have completely dropped support for `{php}` and `{include_php}` tags and embedded PHP in templates. +Check your templates for this, and rewrite any embedded PHP blocks, by moving logic to your PHP files or by +creating a [plugin function](./programmers/plugins/plugins-functions.md). + +### Other changes + +Search your code for the following changes: + +- `SMARTY_RESOURCE_CHAR_SET` and `SMARTY_RESOURCE_DATE_FORMAT` constants have been removed +- `Smarty::muteExpectedErrors` and `Smarty::unmuteExpectedErrors` API methods have been removed +- `Smarty::getVariable` method has been removed. Use [Smarty::getTemplateVars](programmers/api-functions/api-get-template-vars.md) instead. +- [Smarty::registerResource](programmers/api-functions/api-register-resource.md) no longer accepts an array of callback functions + + + + + diff --git a/vendor/smarty/smarty/libs/Smarty.class.php b/vendor/smarty/smarty/libs/Smarty.class.php index f102d889e..0a47c8350 100644 --- a/vendor/smarty/smarty/libs/Smarty.class.php +++ b/vendor/smarty/smarty/libs/Smarty.class.php @@ -107,7 +107,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '4.3.4'; + const SMARTY_VERSION = '4.4.1'; /** * define variable scopes */ diff --git a/vendor/smarty/smarty/libs/plugins/modifier.implode.php b/vendor/smarty/smarty/libs/plugins/modifier.implode.php new file mode 100644 index 000000000..679d71d72 --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/modifier.implode.php @@ -0,0 +1,15 @@ +<?php +/** + * Smarty plugin + * + * @package Smarty + * @subpackage PluginsModifier + */ + +function smarty_modifier_implode($values, $separator = '') +{ + if (is_array($separator)) { + return implode((string) ($values ?? ''), (array) $separator); + } + return implode((string) ($separator ?? ''), (array) $values); +} diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.json_encode.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.json_encode.php new file mode 100644 index 000000000..629277f28 --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.json_encode.php @@ -0,0 +1,11 @@ +<?php + +/** + * Smarty plugin + * + * @package Smarty + * @subpackage PluginsModifierCompiler + */ +function smarty_modifiercompiler_json_encode($params) { + return 'json_encode(' . $params[0] . (isset($params[1]) ? ', (int) ' . $params[1] : '') . ')'; +} diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.substr.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.substr.php new file mode 100644 index 000000000..17721f52b --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.substr.php @@ -0,0 +1,12 @@ +<?php + +/** + * Smarty plugin + * + * @package Smarty + * @subpackage PluginsModifierCompiler + */ +function smarty_modifiercompiler_substr($params) { + return 'substr((string) ' . $params[0] . ', (int) ' . $params[1] . + (isset($params[2]) ? ', (int) ' . $params[2] : '') . ')'; +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php index 96bd37244..78f1c0763 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -93,7 +93,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } // autoescape html if ($compiler->template->smarty->escape_html) { - $output = "htmlspecialchars((string) {$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')"; + $output = "htmlspecialchars((string) ({$output}), ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')"; } // loop over registered filters if (!empty($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ])) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php index 6f526c38a..4ddcfcd11 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php @@ -94,7 +94,7 @@ class Smarty_Internal_ErrorHandler } if ($this->allowUndefinedArrayKeys && preg_match( - '/^(Undefined index|Undefined array key|Trying to access array offset on value of type)/', + '/^(Undefined index|Undefined array key|Trying to access array offset on)/', $errstr )) { return; // suppresses this error diff --git a/vendor/smarty/smarty/mkdocs.yml b/vendor/smarty/smarty/mkdocs.yml index 7762cd75e..66949b809 100644 --- a/vendor/smarty/smarty/mkdocs.yml +++ b/vendor/smarty/smarty/mkdocs.yml @@ -26,7 +26,9 @@ markdown_extensions: nav: - Home: 'index.md' - - 'Getting started': 'getting-started.md' + - 'Getting started': + - Introduction: 'getting-started.md' + - 'Upgrading from an older version': 'upgrading.md' - 'Designers': - 'Basic Syntax': - Introduction: 'designers/language-basic-syntax/index.md' diff --git a/vendor/smarty/smarty/run-tests-for-all-php-versions.sh b/vendor/smarty/smarty/run-tests-for-all-php-versions.sh index b64f01e40..79bebb8a6 100755 --- a/vendor/smarty/smarty/run-tests-for-all-php-versions.sh +++ b/vendor/smarty/smarty/run-tests-for-all-php-versions.sh @@ -10,4 +10,6 @@ docker-compose run php72 ./run-tests.sh $@ && \ docker-compose run php73 ./run-tests.sh $@ && \ docker-compose run php74 ./run-tests.sh $@ && \ docker-compose run php80 ./run-tests.sh $@ && \ -docker-compose run php81 ./run-tests.sh $@ +docker-compose run php81 ./run-tests.sh $@ && \ +docker-compose run php82 ./run-tests.sh $@ && \ +docker-compose run php83 ./run-tests.sh $@ |