From 5dde3a363b14dc0c24972b547f14f3a1e0924d71 Mon Sep 17 00:00:00 2001
From: Oliver Hader <oliver@typo3.org>
Date: Fri, 17 Nov 2017 14:53:10 +0100
Subject: [PATCH] [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 <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
---
 typo3/sysext/frontend/Classes/Imaging/GifBuilder.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
GitLab