fixed handling of multiple identical calls to {insert}.

the function was called multiple times, but all inserts where replaced
by the results of the first call to the insert function.
This commit is contained in:
messju
2005-11-26 16:59:02 +00:00
parent bf55612944
commit 3cb166ba4a
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fix handling of multiple identical inserts in one display()-call (messju)
- replace {} string access with equivalent substr() to avoid E_STRICT
warnings in PHP 5.1 (boots)
- return valid reference in get_config_vars() when given var is

View File

@@ -52,7 +52,7 @@ function smarty_core_process_cached_inserts($params, &$smarty)
$replace = '';
}
$params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']);
$params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');