diff --git a/lib/smarty/libs/Smarty.class.php b/lib/smarty/libs/Smarty.class.php index 5d2e3a4b..b285a99e 100644 --- a/lib/smarty/libs/Smarty.class.php +++ b/lib/smarty/libs/Smarty.class.php @@ -107,7 +107,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '4.3.0'; + const SMARTY_VERSION = '4.5.3'; /** * define variable scopes */ @@ -1386,8 +1386,7 @@ class Smarty extends Smarty_Internal_TemplateBase } /** - * Activates PHP7 compatibility mode: - * - converts E_WARNINGS for "undefined array key" and "trying to read property of null" errors to E_NOTICE + * Mutes errors for "undefined index", "undefined array key" and "trying to read property of null". * * @void */ @@ -1396,7 +1395,7 @@ class Smarty extends Smarty_Internal_TemplateBase } /** - * Indicates if PHP7 compatibility mode is set. + * Indicates if Smarty will mute errors for "undefined index", "undefined array key" and "trying to read property of null". * @bool */ public function isMutingUndefinedOrNullWarnings(): bool { diff --git a/lib/smarty/libs/debug.tpl b/lib/smarty/libs/debug.tpl index 4f82a582..cd932566 100644 --- a/lib/smarty/libs/debug.tpl +++ b/lib/smarty/libs/debug.tpl @@ -167,9 +167,7 @@ {/capture} diff --git a/lib/smarty/libs/plugins/function.math.php b/lib/smarty/libs/plugins/function.math.php index f9cf67fe..34912d23 100644 --- a/lib/smarty/libs/plugins/function.math.php +++ b/lib/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/lib/smarty/libs/plugins/modifier.escape.php b/lib/smarty/libs/plugins/modifier.escape.php index 11e44682..e168679c 100644 --- a/lib/smarty/libs/plugins/modifier.escape.php +++ b/lib/smarty/libs/plugins/modifier.escape.php @@ -115,7 +115,9 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements '