From cf1eba847e0e123d029e71ed9a82da8f6f4d0585 Mon Sep 17 00:00:00 2001 From: sgalinsk Date: Tue, 22 Feb 2011 22:10:39 +0000 Subject: [PATCH] Fixed bug #17483: GifBuilder - meaningfulTempFilePrefix can cause invalid image urls git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10553 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ typo3/sysext/cms/tslib/class.tslib_gifbuilder.php | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5fec8d..3bac2eb 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-02-22 Stefan Galinski + + * Fixed bug #17483: GifBuilder - meaningfulTempFilePrefix can cause invalid image urls + 2011-02-22 Stanislas Rolland * Fixed bug #17695: htmlArea RTE: Removing format may remove content diff --git a/typo3/sysext/cms/tslib/class.tslib_gifbuilder.php b/typo3/sysext/cms/tslib/class.tslib_gifbuilder.php index 5ed0d0d..653605d 100644 --- a/typo3/sysext/cms/tslib/class.tslib_gifbuilder.php +++ b/typo3/sysext/cms/tslib/class.tslib_gifbuilder.php @@ -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'])) . '_'; } -- 2.1.4