From 497f9e888cbed158144d0a383323c42dc89c5ef3 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Fri, 25 Aug 2023 10:43:02 +0200 Subject: [PATCH] Typecast imagefocus. --- source/php/Component/Segment/Segment.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/php/Component/Segment/Segment.php b/source/php/Component/Segment/Segment.php index e5494703..11fe30d2 100644 --- a/source/php/Component/Segment/Segment.php +++ b/source/php/Component/Segment/Segment.php @@ -117,8 +117,12 @@ public function init() $this->data['classList'][] = $this->getBaseClass() . '--content-background-' . $contentBackground; } + if(is_object($imageFocus)) { + $imageFocus = (array) $imageFocus; + } + //Add background position to image styles - if (array_filter($imageFocus)) { + if (is_array($imageFocus) && array_filter((array) $imageFocus)) { $this->data['imageStyle']['background-position'] = $imageFocus['left'] . "% " . $imageFocus['top'] . "%"; }