Browse Source

Fix a couple of bugs in the Arr class.

Taylor Otwell 13 years ago
parent
commit
cd90845acc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      system/arr.php

+ 2 - 2
system/arr.php

@@ -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();
 			}