projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
028ad99
)
Fixed user config values unavailable error generated before user login
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sun, 1 Oct 2017 21:03:41 +0000
(23:03 +0200)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sun, 1 Oct 2017 21:03:41 +0000
(23:03 +0200)
includes/current_user.inc
patch
|
blob
|
history
diff --git
a/includes/current_user.inc
b/includes/current_user.inc
index 239324c69dd0f304942fbc8980a88da21eb68afe..431cfefe2546cd90dbc56968a16578f4898208ea 100644
(file)
--- a/
includes/current_user.inc
+++ b/
includes/current_user.inc
@@
-683,10
+683,12
@@
function array_append(&$array, $elements)
//
function array_search_value($needle, $haystack, $valuekey=null)
{
//
function array_search_value($needle, $haystack, $valuekey=null)
{
- foreach($haystack as $key => $value) {
- $val = isset($valuekey) ? @$value[$valuekey] : $value;
- if ($needle == $val){
- return $value;
+ if (is_array($haystack)) {
+ foreach($haystack as $key => $value) {
+ $val = isset($valuekey) ? @$value[$valuekey] : $value;
+ if ($needle == $val){
+ return $value;
+ }
}
}
return null;
}
}
return null;
@@
-698,13
+700,14
@@
function array_search_value($needle, $haystack, $valuekey=null)
function array_search_keys($needle, $haystack, $valuekey=null)
{
$keys = array();
function array_search_keys($needle, $haystack, $valuekey=null)
{
$keys = array();
- if
($haystack)
+ if
(is_array($haystack)) {
foreach($haystack as $key => $value) {
$val = isset($valuekey) ? @$value[$valuekey] : $value;
if ($needle == $val){
$keys[] = $key;
}
}
foreach($haystack as $key => $value) {
$val = isset($valuekey) ? @$value[$valuekey] : $value;
if ($needle == $val){
$keys[] = $key;
}
}
+ }
return $keys;
}
//
return $keys;
}
//