[BUGFIX] GIFBUILDER files cannot be delivered via web server 12/54712/2
authorOliver Hader <oliver@typo3.org>
Fri, 17 Nov 2017 13:53:10 +0000 (14:53 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 20 Nov 2017 23:42:57 +0000 (00:42 +0100)
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/54712
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: TYPO3com <no-reply@typo3.com>
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

index 1fc8670..f2c657a 100644 (file)
@@ -700,7 +700,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);