aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php')
-rw-r--r--library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
index 87bb0cf4a..689636adb 100644
--- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
+++ b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
@@ -27,6 +27,9 @@ class Smarty_Internal_Runtime_Foreach
// thus rewind() and valid() methods may not be present
return iterator_count($value->getIterator());
} elseif ($value instanceof Iterator) {
+ if ($value instanceof Generator) {
+ return 1;
+ }
return iterator_count($value);
} elseif ($value instanceof PDOStatement) {
return $value->rowCount();