diff options
author | Mario <mario@mariovavti.com> | 2023-10-05 10:24:46 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-10-05 10:24:46 +0000 |
commit | 3d1171de8d72d9c400c76fed6e947fef80fa9804 (patch) | |
tree | 3a211a03ed43d54c4f19ad84fc87617ab12ec62a /vendor/smarty | |
parent | 6e09754d067f19fb38d26f3c8e6afd6551fb9e9d (diff) | |
download | volse-hubzilla-3d1171de8d72d9c400c76fed6e947fef80fa9804.tar.gz volse-hubzilla-3d1171de8d72d9c400c76fed6e947fef80fa9804.tar.bz2 volse-hubzilla-3d1171de8d72d9c400c76fed6e947fef80fa9804.zip |
composer update smarty
Diffstat (limited to 'vendor/smarty')
8 files changed, 37 insertions, 10 deletions
diff --git a/vendor/smarty/smarty/CHANGELOG.md b/vendor/smarty/smarty/CHANGELOG.md index 899cfd7e7..04be00ec8 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.3.4] - 2023-09-14 + +## [4.3.3] - 2023-09-14 + +### Fixed +- `|strip_tags` does not work if the input is 0 [#890](https://github.com/smarty-php/smarty/issues/890) +- Use of negative numbers in {math} equations [#895](https://github.com/smarty-php/smarty/issues/895) + +## [4.3.2] - 2023-07-19 + +### Fixed +- `$smarty->muteUndefinedOrNullWarnings()` now also mutes PHP8 warnings for undefined properties + ## [4.3.1] - 2023-03-28 ### Security diff --git a/vendor/smarty/smarty/libs/Smarty.class.php b/vendor/smarty/smarty/libs/Smarty.class.php index 81dc6ab52..f102d889e 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.1'; + const SMARTY_VERSION = '4.3.4'; /** * define variable scopes */ diff --git a/vendor/smarty/smarty/libs/debug.tpl b/vendor/smarty/smarty/libs/debug.tpl index 4f82a5820..cd9325668 100644 --- a/vendor/smarty/smarty/libs/debug.tpl +++ b/vendor/smarty/smarty/libs/debug.tpl @@ -167,9 +167,7 @@ </html> {/capture} <script type="text/javascript"> - {$id = '__Smarty__'} - {if $display_mode}{$id = "$offset$template_name"|md5}{/if} - _smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); + _smarty_console = window.open("", "console{$targetWindow}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); _smarty_console.document.close(); </script> diff --git a/vendor/smarty/smarty/libs/plugins/function.math.php b/vendor/smarty/smarty/libs/plugins/function.math.php index f9cf67fe7..34912d239 100644 --- a/vendor/smarty/smarty/libs/plugins/function.math.php +++ b/vendor/smarty/smarty/libs/plugins/function.math.php @@ -67,7 +67,7 @@ function smarty_function_math($params, $template) $equation = preg_replace('/\s+/', '', $equation); // Adapted from https://www.php.net/manual/en/function.eval.php#107377 - $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number + $number = '-?(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; $operators = '[,+\/*\^%-]'; // Allowed math operators $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)*\)|\((?1)*\)))(?:'.$operators.'(?1))?)+$/'; diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php index bd866a61f..fd6cc7251 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php @@ -21,7 +21,7 @@ function smarty_modifiercompiler_strip_tags($params) { if (!isset($params[ 1 ]) || $params[ 1 ] === true || trim($params[ 1 ], '"') === 'true') { - return "preg_replace('!<[^>]*?>!', ' ', {$params[0]} ?: '')"; + return "preg_replace('!<[^>]*?>!', ' ', (string) {$params[0]})"; } else { return 'strip_tags((string) ' . $params[ 0 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php index 570819d26..da67904c5 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php @@ -238,9 +238,12 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_config_vars = $ptr->config_vars; ksort($_config_vars); $debugging = $smarty->debugging; + $templateName = $obj->source->type . ':' . $obj->source->name; + $displayMode = $debugging === 2 || !$full; + $offset = $this->offset * 50; $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj); if ($obj->_isTplObj()) { - $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name); + $_template->assign('template_name', $templateName); } if ($obj->_objType === 1 || $full) { $_template->assign('template_data', $this->template_data[ $this->index ]); @@ -250,8 +253,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_template->assign('assigned_vars', $_assigned_vars); $_template->assign('config_vars', $_config_vars); $_template->assign('execution_time', microtime(true) - $smarty->start_time); - $_template->assign('display_mode', $debugging === 2 || !$full); - $_template->assign('offset', $this->offset * 50); + $_template->assign('targetWindow', $displayMode ? md5("$offset$templateName") : '__Smarty__'); + $_template->assign('offset', $offset); echo $_template->fetch(); if (isset($full)) { $this->index--; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php index f57cc21ff..6f526c38a 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php @@ -18,6 +18,12 @@ class Smarty_Internal_ErrorHandler public $allowUndefinedVars = true; /** + * Allows {$foo->propName} where propName is undefined. + * @var bool + */ + public $allowUndefinedProperties = true; + + /** * Allows {$foo.bar} where bar is unset and {$foo.bar1.bar2} where either bar1 or bar2 is unset. * @var bool */ @@ -80,6 +86,13 @@ class Smarty_Internal_ErrorHandler return; // suppresses this error } + if ($this->allowUndefinedProperties && preg_match( + '/^(Undefined property)/', + $errstr + )) { + return; // suppresses this error + } + if ($this->allowUndefinedArrayKeys && preg_match( '/^(Undefined index|Undefined array key|Trying to access array offset on value of type)/', $errstr diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php index 37d8f0a9e..b78a3b600 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php @@ -85,7 +85,7 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base * * @param Smarty_Internal_Template $_template * - * @return string + * @return void * @throws Exception */ public function render(Smarty_Internal_Template $_template) |