From: Chuck Hagenbuch Date: Sun, 6 Jun 2010 18:16:55 +0000 (-0400) Subject: Make sure that $options['locals'] is an array or Traversable before trying to loop it. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f7fe39fca50f2c9b2887fe31ec1fec04595beaf2;p=horde.git Make sure that $options['locals'] is an array or Traversable before trying to loop it. --- diff --git a/framework/View/lib/Horde/View/Base.php b/framework/View/lib/Horde/View/Base.php index 6b09e8f6e..61edf1ac3 100644 --- a/framework/View/lib/Horde/View/Base.php +++ b/framework/View/lib/Horde/View/Base.php @@ -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