Further update to `element()` to remove more unexpected results.
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index 0dfc3e1..5a7f633 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -52,7 +52,7 @@
*/
function element($item, $array, $default = NULL)
{
- return ! isset($array[$item]) ? $default : $array[$item];
+ return array_key_exists($array[$item]) ? $array[$item] : $default;
}
}
@@ -95,7 +95,7 @@
foreach ($items as $item)
{
- $return[$item] = isset($array[$item]) ? $array[$item] : $default;
+ $return[$item] = array_key_exists($array[$item]) ? $array[$item] : $default;
}
return $return;