Commit cd90845a authored by Taylor Otwell's avatar Taylor Otwell

Fix a couple of bugs in the Arr class.

parent 4d38ec02
......@@ -20,7 +20,7 @@ class Arr {
foreach (explode('.', $key) as $segment)
{
if ( ! array_key_exists($segment, $array))
if ( ! is_array($array) or ! array_key_exists($segment, $array))
{
return is_callable($default) ? call_user_func($default) : $default;
}
......@@ -52,7 +52,7 @@ class Arr {
{
$key = array_shift($keys);
if ( ! isset($array[$key]))
if ( ! isset($array[$key]) or ! is_array($array[$key]))
{
$array[$key] = array();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment