Skip to content

Commit ab17a7d

Browse files
committed
[BUGFIX] Avoid using native filemtime for calculation of paths
When generating the preview images in the FileList, a change was added to use filemtime for "absolute path", whereas paths such as "/_assets/..." are technically absolute, but are already absolute web paths generated by "getPublicUrl()" of FAL. For this reason, cache busting is added manually via the FAL API. Resolves: #106368 Related: #101968 Related: #82855 Releases: main, 13.4 Change-Id: If8f76c195f8c5c395b038b0fc4fdeb419aa59033 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89052 Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: core-ci <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Andreas Kienast <akienast@scripting-base.de> Reviewed-by: Benni Mack <benni@typo3.org>
1 parent 6a00337 commit ab17a7d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

typo3/sysext/filelist/Classes/FileList.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,11 @@ protected function renderThumbnail(ResourceView $resourceView): string
704704
return '';
705705
}
706706

707-
if (PathUtility::isAbsolutePath($thumbnailUrl)) {
708-
$thumbnailUrl .= '?' . filemtime($processedFile->getForLocalProcessing(false));
707+
// We cannot use GeneralUtility::createVersionNumberedFilename() here, because we do not
708+
// know if the file is on a Local storage or if the publicURL has been generated by a
709+
// custom Event Listener
710+
if (!str_contains($thumbnailUrl, '?') && !PathUtility::hasProtocolAndScheme($thumbnailUrl)) {
711+
$thumbnailUrl .= '?' . $processedFile->getModificationTime();
709712
}
710713

711714
return '<br><img src="' . htmlspecialchars($thumbnailUrl) . '" ' .

0 commit comments

Comments
 (0)