From 5792a85771c80ad4c9ea446526bd7786ded33754 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Mon, 28 Aug 2023 14:25:29 +0200 Subject: [PATCH] Check if is array before filtering --- source/php/Component/Slider__item/Slider__item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/php/Component/Slider__item/Slider__item.php b/source/php/Component/Slider__item/Slider__item.php index 5b7e3db9..d552ad95 100644 --- a/source/php/Component/Slider__item/Slider__item.php +++ b/source/php/Component/Slider__item/Slider__item.php @@ -58,7 +58,7 @@ public function init() { $this->data['attributeList']['aria-labeledby'] = $this->getUid() . '__heading'; } - if($focusPoint) { + if(!empty($focusPoint)) { //Create image style tag $this->data['imageStyle'] = []; @@ -69,7 +69,7 @@ public function init() { } //Add background position to image styles - if(array_filter($focusPoint)) { + if(is_array($focusPoint) && array_filter($focusPoint)) { $this->data['imageStyle']['background-position'] = $focusPoint['left'] . "% " . $focusPoint['top'] . "%"; }