mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- 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:
@@ -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
|
||||
|
||||
|
@@ -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'])) {
|
||||
|
@@ -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
Reference in New Issue
Block a user