From 7d95139fa963546fcbc13fdad9f78f428d75ba5d 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 f4f67e5054..ac65f48aa0 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 7c7544114c..830748f0fc 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -1777,7 +1777,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));