Make sure that $options['locals'] is an array or Traversable before trying to loop it.
authorChuck Hagenbuch <chuck@horde.org>
Sun, 6 Jun 2010 18:16:55 +0000 (14:16 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sun, 6 Jun 2010 18:17:25 +0000 (14:17 -0400)
framework/View/lib/Horde/View/Base.php

index 6b09e8f..61edf1a 100644 (file)
@@ -290,8 +290,10 @@ abstract class Horde_View_Base
         }
 
         // set local variables to be used in the partial
-        foreach ($options['locals'] as $key => $val) {
-            $locals[$key] = $val;
+        if (isset($options['locals']) && (is_array($options['locals']) || $options['locals'] instanceof Traversable)) {
+            foreach ($options['locals'] as $key => $val) {
+                $locals[$key] = $val;
+            }
         }
 
         // collection