diff --git a/change_log.txt b/change_log.txt index 4ae9ebc4..a91a02f1 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,7 @@ ===== 3.1.32 - dev === - +13.4.2017 + - bugfix array_merge() parameter should be checked https://github.com/smarty-php/smarty/issues/350 + ===== 3.1.31 ===== (14.12.2016) 23.11.2016 - move template object cache into static variables diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 158d654c..682942ab 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -663,8 +663,12 @@ abstract class Smarty_Internal_TemplateCompilerBase // if compiler function plugin call it now if ($plugin_type == Smarty::PLUGIN_COMPILER) { $new_args = array(); - foreach ($args as $mixed) { - $new_args = array_merge($new_args, $mixed); + foreach ($args as $key => $mixed) { + if (is_array($mixed)) { + $new_args = array_merge($new_args, $mixed); + } else { + $new_args[ $key ] = $mixed; + } } return call_user_func_array($this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ], array($new_args, $this));