From 9d4a0bcb076cfc688014c40284b6f17ae4461dd3 Mon Sep 17 00:00:00 2001 From: messju Date: Tue, 11 Nov 2003 22:46:13 +0000 Subject: [PATCH] fix handling of assign inside {insert}-tags --- NEWS | 1 + libs/core/core.process_cached_inserts.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index cae02dd9..8e075d7d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fix handling of assign inside {insert}-tags (messju) - fix handling if [...] inside triple-quotes in config-files (messju) - fix handling of simple-math-operators inside modifiers (Dominik, messju) - fix handling of trailing-slashes in open_basedir in diff --git a/libs/core/core.process_cached_inserts.php b/libs/core/core.process_cached_inserts.php index 2a4994ff..0e368fdd 100644 --- a/libs/core/core.process_cached_inserts.php +++ b/libs/core/core.process_cached_inserts.php @@ -45,7 +45,12 @@ function smarty_core_process_cached_inserts($params, &$smarty) } $function_name = $smarty->_plugins['insert'][$name][0]; - $replace = $function_name($args, $smarty); + if (empty($args['assign'])) { + $replace = $function_name($args, $smarty); + } else { + $smarty->assign($args['assign'], $function_name($args, $smarty)); + $replace = ''; + } $params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']); if ($smarty->debugging) {