Skip to content

Commit

Permalink
Check if is array before filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Aug 28, 2023
1 parent 58e51fd commit 5792a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/php/Component/Slider__item/Slider__item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = [];
Expand All @@ -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'] . "%";
}

Expand Down

0 comments on commit 5792a85

Please sign in to comment.