Check variable existance and type to avoid some warnings

This commit is contained in:
Nathan Gray 2012-06-19 19:52:07 +00:00
parent 60ad22de68
commit cd6ff18379
2 changed files with 28 additions and 19 deletions

View File

@ -29,6 +29,8 @@ class etemplate_widget_historylog extends etemplate_widget
{
$form_name = self::form_name($cname, $this->id);
if(is_array(self::$request->content[$form_name]['status-widgets']))
{
foreach(self::$request->content[$form_name]['status-widgets'] as $key => $type)
{
if(!is_array($type))
@ -53,4 +55,5 @@ class etemplate_widget_historylog extends etemplate_widget
}
}
}
}
?>

View File

@ -376,11 +376,17 @@ class etemplate_widget_menupopup extends etemplate_widget
}
// Make sure all values are present, even if not normally sent (according to preferences)
if(is_array($value))
{
$remaining = array_diff_key($value, $options);
}
if(is_array($remaining))
{
foreach($remaining as $id)
{
$options[$id] = !$id && !is_numeric($rows) ? lang($rows) : self::accountInfo($id,null,$type2,$type=='both');
}
}
break;
case 'select-year': // options: #rows,#before(default=3),#after(default=2)