- bugfix {counter} and {cycle} plugin assigned result to smarty variable not in local(template) scope

- bugfix templates containing just {strip} {/strip} tags did produce an error
This commit is contained in:
Uwe.Tews
2010-09-07 16:24:34 +00:00
parent 96e3d9937a
commit a2f50cebd4
4 changed files with 876 additions and 867 deletions

View File

@@ -1,3 +1,8 @@
07/09/2010
- bugfix {counter} and {cycle} plugin assigned result to smarty variable not in local(template) scope
- bugfix templates containing just {strip} {/strip} tags did produce an error
23/08/2010
- fixed E_STRICT errors for uninitialized variables

View File

@@ -16,9 +16,10 @@
* (Smarty online manual)
* @param array parameters
* @param Smarty
* @param object $template template object
* @return string|null
*/
function smarty_function_counter($params, $smarty)
function smarty_function_counter($params, $smarty, $template)
{
static $counters = array();
@@ -42,7 +43,7 @@ function smarty_function_counter($params, $smarty)
}
if (isset($counter['assign'])) {
$smarty->assign($counter['assign'], $counter['count']);
$template->assign($counter['assign'], $counter['count']);
}
if (isset($params['print'])) {

View File

@@ -39,11 +39,12 @@
* @author credit to Jason Sweat <jsweat_php@yahoo.com>
* @version 1.3
* @param array
* @param Smarty
* @param object $smarty Smarty object
* @param object $template template object
* @return string|null
*/
function smarty_function_cycle($params, $smarty)
function smarty_function_cycle($params, $smarty, $template)
{
static $cycle_vars;
@@ -83,7 +84,7 @@ function smarty_function_cycle($params, $smarty)
if (isset($params['assign'])) {
$print = false;
$smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
$template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
}
if($print) {

File diff suppressed because it is too large Load Diff