From: Oliver Hader Date: Fri, 17 Nov 2017 13:53:10 +0000 (+0100) Subject: [BUGFIX] GIFBUILDER files cannot be delivered via web server X-Git-Tag: v9.0.0~217 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/5dde3a363b14dc0c24972b547f14f3a1e0924d71?ds=sidebyside [BUGFIX] GIFBUILDER files cannot be delivered via web server GIFBUILDER uses provided file names and text snippets in order to generate the final name for files to be written to. In case text snippets start with a dot, this is also reflected into the file name - preventing some web servers to deliver the file since it's considered to be internal. Resolves: #83029 Releases: master, 8.7 Change-Id: Iebed832c1c2429c7400373a6af4d5ae14a9ea18e Reviewed-on: https://review.typo3.org/54677 Tested-by: TYPO3com Reviewed-by: Georg Ringer Tested-by: Georg Ringer Reviewed-by: Stefan Neufeind Tested-by: Stefan Neufeind --- diff --git a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php index bf5f98f25677..d2a1e1f26b18 100644 --- a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php +++ b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php @@ -699,7 +699,7 @@ class GifBuilder extends GraphicalFunctions /** @var $basicFileFunctions \TYPO3\CMS\Core\Utility\File\BasicFileUtility */ $basicFileFunctions = GeneralUtility::makeInstance(BasicFileUtility::class); $filePrefix = implode('_', array_merge($this->combinedTextStrings, $this->combinedFileNames)); - $filePrefix = $basicFileFunctions->cleanFileName($filePrefix); + $filePrefix = $basicFileFunctions->cleanFileName(ltrim($filePrefix, '.')); // shorten prefix to avoid overly long file names $filePrefix = substr($filePrefix, 0, 100);