From c7d80123cef766c20c937553e4a54d66292e7902 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 1 Jun 2021 16:35:34 +0200 Subject: [PATCH] Fix error key(): Argument #1 ($array) must be of type array, null given --- calendar/inc/class.calendar_uiforms.inc.php | 2 +- infolog/inc/class.infolog_ui.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index f7297a382b..5ee36a63a9 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -303,7 +303,7 @@ class calendar_uiforms extends calendar_ui // (add, edit, update, delete) $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 unset($content['button']); unset($content['action']); diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 3bc4ee7c89..1e4b17740f 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -1781,7 +1781,7 @@ class infolog_ui $referer = $content['referer']; unset($content['referer']); $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 //info_cc expects an comma separated string //error_log(__METHOD__.__LINE__.array2string($content));