From 1fad8bf7668529258e13d2f60bb7bdd7bb0ed3bd Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 28 Nov 2022 14:04:24 +0100 Subject: [PATCH] fix array_merge(): Argument #2 must be of type array, int given --- resources/inc/class.resources_ui.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/inc/class.resources_ui.inc.php b/resources/inc/class.resources_ui.inc.php index e16be3773d..5b28197e4a 100755 --- a/resources/inc/class.resources_ui.inc.php +++ b/resources/inc/class.resources_ui.inc.php @@ -476,11 +476,11 @@ class resources_ui } $nm_session_data = Api\Cache::getSession('resources', 'index_nm'); - $res_id = is_numeric($content) ? (int)$content : $content['res_id']; + $res_id = is_scalar($content) && is_numeric($content) ? (int)$content : $content['res_id']; if (isset($_GET['res_id'])) $res_id = $_GET['res_id']; if (isset($nm_session_data['filter2']) && $nm_session_data['filter2'] > 0) $accessory_of = $nm_session_data['filter2']; if (isset($_GET['accessory_of'])) $accessory_of = $_GET['accessory_of']; - $content = array('res_id' => $res_id, 'cat_id' => $content['cat_id']); + $content = is_array($content) ? $content : array('res_id' => $res_id); if ($res_id > 0) { $content = array_merge($this->bo->read($res_id), $content); @@ -586,4 +586,3 @@ class resources_ui } } -