Fixed bug #17483: GifBuilder - meaningfulTempFilePrefix can cause invalid image urls
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_gifbuilder.php
index 5ed0d0d..653605d 100644 (file)
@@ -715,10 +715,11 @@ class tslib_gifBuilder extends t3lib_stdGraphic {
                $meaningfulPrefix = '';
 
                if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
+                       /** @var $basicFileFunctions t3lib_basicFileFunctions */
+                       $basicFileFunctions = t3lib_div::makeInstance('t3lib_basicFileFunctions');
+                       
                        $meaningfulPrefix = implode('_', array_merge($this->combinedTextStrings, $this->combinedFileNames));
-                               // Convert raw string to a nice ASCII-only string without spaces
-                       $meaningfulPrefix = $GLOBALS['TSFE']->csConvObj->specCharsToASCII($GLOBALS['TSFE']->renderCharset, $meaningfulPrefix);
-                       $meaningfulPrefix = str_replace(' ', '_', $meaningfulPrefix);
+                       $meaningfulPrefix = $basicFileFunctions->cleanFileName($meaningfulPrefix);
                        $meaningfulPrefix = substr($meaningfulPrefix, 0, intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix'])) . '_';
                }