cvs: smarty / NEWS /libs/internals core.process_cached_inserts.php
[email protected] ("Messju Mohr")
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvsmessju1133024342@cvsserver> |
messju Sat Nov 26 11:59:02 2005 EDT
Modified files:
/smarty NEWS
/smarty/libs/internals core.process_cached_inserts.php
Log:
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.
http://cvs.php.net/diff.php/smarty/NEWS?r1=1.517&r2=1.518&ty=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.517 smarty/NEWS:1.518
--- smarty/NEWS:1.517 Wed Nov 23 15:36:01 2005
+++ smarty/NEWS Sat Nov 26 11:59:00 2005
@@ -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
http://cvs.php.net/diff.php/smarty/libs/internals/core.process_cached_inserts.php?r1=1.2&r2=1.3&ty=u
Index: smarty/libs/internals/core.process_cached_inserts.php
diff -u smarty/libs/internals/core.process_cached_inserts.php:1.2 smarty/libs/internals/core.process_cached_inserts.php:1.3
--- smarty/libs/internals/core.process_cached_inserts.php:1.2 Fri Sep 17 22:09:35 2004
+++ smarty/libs/internals/core.process_cached_inserts.php Sat Nov 26 11:59:02 2005
@@ -52,7 +52,7 @@
$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');