aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-01-21 15:10:02 +0100
committerplegall <plg@piwigo.org>2016-01-21 15:10:02 +0100
commitd33051cb7236a930c1baf879fee75e92c35a93ee (patch)
tree4f7c596268420cc670cbbf767d941fadb07a1b26 /include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
parent491464355911334ecbf49b742545286e82961112 (diff)
update to Smarty 3.1.29
Diffstat (limited to 'include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php')
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
index 87bb0cf4a..689636adb 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php
+++ b/include/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();