From: Janusz Dobrowolski Date: Tue, 11 May 2010 11:26:43 +0000 (+0000) Subject: Fix in array_search_keys X-Git-Tag: v2.4.2~19^2~897 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=f76f91d9075259d11d8ad7c06795ead39e24d4a4;p=fa-stable.git Fix in array_search_keys --- diff --git a/includes/current_user.inc b/includes/current_user.inc index 017a5405..c4d94539 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -481,12 +481,13 @@ function array_search_value($needle, $haystack, $valuekey=null) function array_search_keys($needle, $haystack, $valuekey=null) { $keys = array(); - foreach($haystack as $key => $value) { - $val = isset($valuekey) ? $value[$valuekey] : $value; - if ($needle == $val){ - $keys[] = $key; + if($haystack) + foreach($haystack as $key => $value) { + $val = isset($valuekey) ? $value[$valuekey] : $value; + if ($needle == $val){ + $keys[] = $key; + } } - } return $keys; } //