diff --git a/NEWS b/NEWS index 31eb61ea..5d3cf392 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/libs/internals/core.process_cached_inserts.php b/libs/internals/core.process_cached_inserts.php index 29cb007e..1d78edd9 100644 --- a/libs/internals/core.process_cached_inserts.php +++ b/libs/internals/core.process_cached_inserts.php @@ -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');