diff --git a/ReadMe.md b/ReadMe.md index 28cff12..ded4fce 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -23,3 +23,24 @@ Alternative setup composer local zip file repot: ## Install package `composer require egrajp/smarty-extended:^4.3` + +## How to update + +1) update the original composer for ^4.3 +2) copy over the src/sysplugins and all base files in src/ +3) check either function.html_checkboxes.php and function.html_options.php have changed +4) copy src/plugins except the above two files, be sure to keep the block.t.php and function_popup*.php +5) Create new release version as official relase number + +## Updated files (different from master) + +### New + +`src/plugins/block.t.php` +`src/plugins/function_popup.php` +`src/plugins/function_popup.init.php` + +### Changed + +`src/plugins/function.html_checkboxes.php` +`src/plugins/function.html_options.php` diff --git a/src/debug.tpl b/src/debug.tpl index 4f82a58..cd93256 100644 --- a/src/debug.tpl +++ b/src/debug.tpl @@ -167,9 +167,7 @@ {/capture} diff --git a/src/plugins/function.math.php b/src/plugins/function.math.php index f9cf67f..34912d2 100644 --- a/src/plugins/function.math.php +++ b/src/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/src/plugins/modifier.escape.php b/src/plugins/modifier.escape.php index 11e4468..e168679 100644 --- a/src/plugins/modifier.escape.php +++ b/src/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 '