From aadb474a7693b5830c2ef0b3037d1681d36079f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 15 Dec 2020 12:10:04 +0100 Subject: [PATCH] Correctly URL-encode singleSRC paths --- src/Resources/contao/templates/rsts_default.html5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Resources/contao/templates/rsts_default.html5 b/src/Resources/contao/templates/rsts_default.html5 index bb163bf..ccd3590 100644 --- a/src/Resources/contao/templates/rsts_default.html5 +++ b/src/Resources/contao/templates/rsts_default.html5 @@ -24,7 +24,7 @@ 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']); } ?> 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)) { @@ -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']) . '"'; } } ?>