From d494d0db2259f85e55712dc1b401685cef796638 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Sun, 16 Jan 2011 16:22:58 +0000 Subject: [PATCH] -bugfix of Iterator object handling in internal _count() method --- change_log.txt | 1 + libs/sysplugins/smarty_internal_template.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 2c628dd4..1caccb9d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== SVN trunk ===== 16/01/2011 -bugfix of ArrayAccess object handling in internal _count() method +-bugfix of Iterator object handling in internal _count() method 14/01/2011 -bugfix removed memory leak while processing compileAllTemplates diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 2767f2bf..799d7944 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -864,7 +864,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { } elseif ($value instanceof Iterator) { $value->rewind(); if ($value->valid()) { - return 1; + return iterator_count($value); } } elseif ($value instanceof PDOStatement) { return $value->rowCount();