diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 01d38c21..0656b77b 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -45,7 +45,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; // compile code if (is_array($function)) { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(array('{$function[0]}','{$function[1]}'),(array({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(array('{$function[0]}','{$function[1]}'),{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } else { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } @@ -60,7 +60,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $this->compiler->has_output = true; // compile code if (is_array($function)) { - $output = "smarty, \$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else { $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } @@ -69,4 +69,4 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php index 83b29d24..80cb1bfa 100644 --- a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -42,7 +42,7 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co $_params = 'array(' . implode(",", $_paramsArray) . ')'; // compile code if (is_array($function)) { - $output = "smarty,\$_smarty_tpl));?>\n"; + $output = "smarty,\$_smarty_tpl);?>\n"; } else { $output = "smarty,\$_smarty_tpl);?>\n"; } @@ -50,4 +50,4 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php index a3a87d14..300764d9 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -48,9 +48,9 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C if (!is_array($function)) { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } else if (is_object($function[0])) { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0],array({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0],{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } else { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(array({$function[0]}','{$function[1]}'),array({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(array('{$function[0]}','{$function[1]}'),{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } } else { // must endblock be nocache? @@ -67,13 +67,13 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C if (!is_array($function)) { $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else if (is_object($function[0])) { - $output = "smarty->registered_plugins['block']['{$base_tag}'][0],array({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty->registered_plugins['block']['{$base_tag}'][0],{$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else { - $output = "smarty, \$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } } return $output."\n"; } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/libs/sysplugins/smarty_internal_compile_private_registered_function.php index 381c7f1d..e7d2cd6b 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_function.php @@ -1,25 +1,25 @@ compiler = $compiler; @@ -43,9 +43,17 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna } $_params = 'array(' . implode(",", $_paramsArray) . ')'; // compile code - $output = "smarty->registered_plugins['function']['{$tag}'][0],array({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl));?>\n"; + $function = $compiler->smarty->registered_plugins['function'][$tag][0]; + // compile code + if (!is_array($function)) { + $output = "smarty,\$_smarty_tpl);?>\n"; + } else if (is_object($function[0])) { + $output = "smarty->registered_plugins['function']['{$tag}'][0],{$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>\n"; + } else { + $output = "smarty,\$_smarty_tpl);?>\n"; + } return $output; } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_filter_handler.php b/libs/sysplugins/smarty_internal_filter_handler.php index 1d81636e..a8a43d48 100644 --- a/libs/sysplugins/smarty_internal_filter_handler.php +++ b/libs/sysplugins/smarty_internal_filter_handler.php @@ -1,31 +1,31 @@ autoload_filters[$type] as $name) { $plugin_name = "Smarty_{$type}filter_{$name}"; if ($smarty->loadPlugin($plugin_name)) { - // use class plugin if found - if (class_exists($plugin_name, false)) { - // loaded class of filter plugin - $output = call_user_func_array(array($plugin_name, 'execute'), array($output, $smarty)); - } elseif (function_exists($plugin_name)) { + if (function_exists($plugin_name)) { // use loaded Smarty2 style plugin - $output = call_user_func_array($plugin_name, array($output, $smarty)); + $output = $plugin_name($output, $smarty); + } elseif (class_exists($plugin_name, false)) { + // loaded class of filter plugin + $output = call_user_func(array($plugin_name, 'execute'), $output, $smarty); } } else { // nothing found, throw exception @@ -52,7 +51,11 @@ class Smarty_Internal_Filter_Handler { // loop over registerd filters of specified type if (!empty($smarty->registered_filters[$type])) { foreach ($smarty->registered_filters[$type] as $key => $name) { - $output = call_user_func_array($smarty->registered_filters[$type][$key], array($output, $smarty)); + if (is_array($smarty->registered_filters[$type][$key])) { + $output = call_user_func($smarty->registered_filters[$type][$key], $output, $smarty); + } else { + $output = $smarty->registered_filters[$type][$key]($output, $smarty); + } } } } @@ -61,4 +64,4 @@ class Smarty_Internal_Filter_Handler { } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_resource_registered.php b/libs/sysplugins/smarty_internal_resource_registered.php index 36a09cdc..92347a17 100644 --- a/libs/sysplugins/smarty_internal_resource_registered.php +++ b/libs/sysplugins/smarty_internal_resource_registered.php @@ -33,7 +33,7 @@ class Smarty_Internal_Resource_Registered { */ public function isExisting($_template) { - if (is_integer($this->getTemplateTimestamp($_template))) { + if (is_integer($_template->getTemplateTimestamp())) { return true; } else { return false;