Skip to content

Commit

Permalink
Fix PHP 8.0 undefined key warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Apr 23, 2021
1 parent af6f786 commit 0b735ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Resources/contao/templates/rsts_default.html5
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@

<?php elseif (! empty($slide['image'])): ?>

<?php if ($slide['image']->href && $tagName !== 'a') {
<?php if (!empty($slide['image']->href) && $tagName !== 'a') {
$tagName = 'a';
$attributes .= ' href="' . $slide['image']->href . '"';
if ($slide['image']->linkTitle) {
Expand All @@ -173,7 +173,7 @@
} ?>

<<?= $tagName ?> data-rsts-type="image" <?= $attributes ?>>
<?php $this->insert('picture_default', array_merge($slide['image']->picture, ['attributes' => $slide['image']->picture['attributes'] . ' ' . $imageAttributes])) ?>
<?php $this->insert('picture_default', array_merge($slide['image']->picture, ['attributes' => ($slide['image']->picture['attributes'] ?? '') . ' ' . $imageAttributes])) ?>
<?php if ($slide['image']->caption): ?>
<p class="rsts-text"><?= $slide['image']->caption ?></p>
<?php endif ?>
Expand Down

0 comments on commit 0b735ae

Please sign in to comment.