Skip to content

Commit

Permalink
Correctly URL-encode singleSRC paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Dec 15, 2020
1 parent b5108bc commit aadb474
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Resources/contao/templates/rsts_default.html5
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<?php endif ?>

<?php if ($this->fullsize && !$image->href) {
$lightboxUrls[] = array(TL_FILES_URL . $image->singleSRC, $image->linkTitle ?: $image->picture['alt']);
$lightboxUrls[] = array(TL_FILES_URL . \Contao\System::urlEncode($image->singleSRC), $image->linkTitle ?: $image->picture['alt']);
} ?>

<?php
Expand All @@ -45,7 +45,7 @@
}
}
elseif ($this->fullsize) {
$attributes[] = 'href="' . TL_FILES_URL . $image->singleSRC . '"';
$attributes[] = 'href="' . TL_FILES_URL . \Contao\System::urlEncode($image->singleSRC) . '"';
$attributes[] = 'data-lightbox="' . substr(md5('mod_rocksolid_slider_' . $this->id), 0, 6) . '"';
}
if (!empty($this->rsts_invertControls)) {
Expand Down Expand Up @@ -178,8 +178,8 @@
}
}
else {
$lightboxUrls[] = array(TL_FILES_URL . $slide['image']->singleSRC, $slide['title']);
$attributes .= ' href="' . TL_FILES_URL . $slide['image']->singleSRC . '" data-lightbox="' . substr(md5('mod_rocksolid_slider_' . $this->id), 0, 6) . '" title="' . \Contao\StringUtil::specialchars($slide['title']) . '"';
$lightboxUrls[] = array(TL_FILES_URL . \Contao\System::urlEncode($slide['image']->singleSRC), $slide['title']);
$attributes .= ' href="' . TL_FILES_URL . \Contao\System::urlEncode($slide['image']->singleSRC) . '" data-lightbox="' . substr(md5('mod_rocksolid_slider_' . $this->id), 0, 6) . '" title="' . \Contao\StringUtil::specialchars($slide['title']) . '"';
}
} ?>

Expand Down

0 comments on commit aadb474

Please sign in to comment.