Fixed bug #15466: meaningfulTempFilePrefix does not convert Umlauts and special chara...
authorJeff Segars <jsegars@alumni.rice.edu>
Tue, 4 Jan 2011 22:48:19 +0000 (22:48 +0000)
committerJeff Segars <jsegars@alumni.rice.edu>
Tue, 4 Jan 2011 22:48:19 +0000 (22:48 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9985 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_gifbuilder.php

index 1125538..db8984e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Follow-up to #15853: Make admin panel styling more bulletproof and remove duplicate styles
        * Fixed bug #16906: Link from Install Tool to User Settings should make User Settings active in the module menu (Thanks to Georg Ringer)
+       * Fixed bug #15466: meaningfulTempFilePrefix does not convert Umlauts and special characters (Thanks to Sebastian Michaelsen)
 
 2011-01-03  Jigal van Hemert  <jigal@xs4all.nl>
 
index a3e6cee..a0c6c61 100644 (file)
@@ -720,17 +720,18 @@ class tslib_gifBuilder extends t3lib_stdGraphic {
 
                if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
                        $meaningfulPrefix = implode('_', array_merge($this->combinedTextStrings, $this->combinedFileNames));
-                               // strip everything non-ascii
-                       $meaningfulPrefix = preg_replace('/[^A-Za-z0-9_-]/', '', trim($meaningfulPrefix));
+                               // 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 = substr($meaningfulPrefix, 0, intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix'])) . '_';
                }
 
                        // WARNING: In PHP5 I discovered that rendering with freetype of Japanese letters was totally corrupt. Not only the wrong glyphs are printed but also some memory stack overflow resulted in strange additional chars - and finally the reason for this investigation: The Bounding box data was changing all the time resulting in new images being generated all the time. With PHP4 it works fine.
-               return $this->tempPath.
-                               $pre.
+               return $this->tempPath .
+                               $pre .
                                $meaningfulPrefix .
-                               t3lib_div::shortMD5(serialize($this->setup)).
-                               '.'.$this->extension();
+                               t3lib_div::shortMD5(serialize($this->setup)) .
+                               '.' . $this->extension();
        }
 
        /**