From 54e5a6bd76a85c5a67543247a3cb7582b4f95995 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 15 Nov 2021 08:26:06 +0100 Subject: [PATCH] fixing/improving condition of last commit --- calendar/inc/class.calendar_merge.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index 39c5c44a1a..60af4f99bb 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -761,7 +761,7 @@ class calendar_merge extends Api\Storage\Merge if((strpos($content, '$$range') !== false || strpos($content, '{{range') !== false) && is_array($ids)) { // Merging into a template that uses range - need ranges, got events - if(is_array($ids) && (is_array($ids[0]) && $ids[0]['id'] || is_string($ids[0]))) + if (is_array($ids) && (is_array($ids[0]) && isset($ids[0]['id']) || is_string($ids[0]))) { // Passed an array of events, to be handled like a date range $events = $ids; @@ -777,7 +777,7 @@ class calendar_merge extends Api\Storage\Merge else if((strpos($content, '$$pagerepeat') !== false || strpos($content, '{{pagerepeat') !== false) && ((strpos($content, '$$range') === false && strpos($content, '{{range') === false))) { - if (is_array($ids) && !empty($ids[0]) && !(is_array($ids[0]) || isset($ids[0]['id']))) + if (is_array($ids) && !(is_array($ids[0]) && isset($ids[0]['id']) || is_string($ids[0]))) { foreach($ids as $range) {