fixed iterators with non-array values
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 22 Oct 2009 01:29:43 +0000 (01:29 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Thu, 22 Oct 2009 01:29:43 +0000 (01:29 +0000)
git-svn-id: http://svn.twig-project.org/trunk@87 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/runtime_for.php

index 5b33c71..f2e508a 100644 (file)
@@ -108,9 +108,9 @@ function twig_set_loop_context(&$context, $iterator, $target)
 
 function twig_get_array_items_filter($array)
 {
-  if (!is_array($array) && is_object($array) && !$array instanceof Iterator)
+  if (!is_array($array) && (!is_object($array) || !$array instanceof Iterator))
   {
-    return array(array(), array());
+    return false;
   }
 
   $result = array();