forked from extern/egroupware
Avoid some 'array_key_exists() expects parameter 2 to be array' warnings by checking first
This commit is contained in:
parent
a0065835a6
commit
05ee7eba37
@ -89,7 +89,7 @@ class admin_cmd_customfield extends admin_cmd
|
||||
unset($old['modified'], $old['modifier'], $old['tab']);
|
||||
foreach($set as $key => $value)
|
||||
{
|
||||
if(array_key_exists($key, $old) && $old[$key] == $value)
|
||||
if(is_array($old) && array_key_exists($key, $old) && $old[$key] == $value)
|
||||
{
|
||||
// Need to keep these 2 in set so we can tell if it was deleted
|
||||
if(!in_array($key, array('id','name')))
|
||||
|
@ -332,7 +332,7 @@ class Customfields extends Transformer
|
||||
);
|
||||
foreach($defaults as $f => $d_value)
|
||||
{
|
||||
$widget->attrs[$f] = array_key_exists($f, $field['values']) ? $field['values'][$f] : $d_value;
|
||||
$widget->attrs[$f] = is_array($field['values']) && array_key_exists($f, $field['values']) ? $field['values'][$f] : $d_value;
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user