Fix error key(): Argument #1 ($array) must be of type array, null given

This commit is contained in:
Hadi Nategh 2021-06-01 16:35:34 +02:00 committed by Ralf Becker
parent 7de75f16c1
commit 7d95139fa9
2 changed files with 2 additions and 2 deletions

View File

@ -303,7 +303,7 @@ class calendar_uiforms extends calendar_ui
// (add, edit, update, delete) // (add, edit, update, delete)
$update_type = $content['id'] ? ($content['recur_type'] == MCAL_RECUR_NONE ? 'update' : 'edit') : 'add'; $update_type = $content['id'] ? ($content['recur_type'] == MCAL_RECUR_NONE ? 'update' : 'edit') : 'add';
$button = @key($content['button']); $button = @key((array)$content['button']);
if (!$button && $content['action']) $button = $content['action']; // action selectbox if (!$button && $content['action']) $button = $content['action']; // action selectbox
unset($content['button']); unset($content['action']); unset($content['button']); unset($content['action']);

View File

@ -1777,7 +1777,7 @@ class infolog_ui
$referer = $content['referer']; unset($content['referer']); $referer = $content['referer']; unset($content['referer']);
$no_popup = $content['no_popup']; unset($content['no_popup']); $no_popup = $content['no_popup']; unset($content['no_popup']);
$button = @key($content['button']); $button = @key((array)$content['button']);
if (!$button && $action) $button = $action; // action selectbox if (!$button && $action) $button = $action; // action selectbox
//info_cc expects an comma separated string //info_cc expects an comma separated string
//error_log(__METHOD__.__LINE__.array2string($content)); //error_log(__METHOD__.__LINE__.array2string($content));