diff -ru typo3_src-4.5.0.original/t3lib/utility/class.t3lib_utility_command.php typo3_src-4.5.0.new/t3lib/utility/class.t3lib_utility_command.php --- typo3_src-4.5.0.original/t3lib/utility/class.t3lib_utility_command.php 2011-01-26 20:36:02.000000000 +0100 +++ typo3_src-4.5.0.new/t3lib/utility/class.t3lib_utility_command.php 2011-02-01 15:26:30.000000000 +0100 @@ -46,7 +46,14 @@ * @return null|array */ public static function exec($command, &$output = NULL, &$returnValue = 0) { + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { + $currentLocale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']); + } $lastLine = exec($command, $output, $returnValue); + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { + setlocale(LC_CTYPE, $currentLocale); + } return $lastLine; } @@ -68,6 +75,18 @@ } $path = t3lib_div::fixWindowsFilePath($path); + // fix path containing whitespace (only if safe_mode is off) + if (!t3lib_utility_PhpOptions::isSafeModeEnabled()) { + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { + $currentLocale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']); + } + $path = escapeshellarg($path); + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { + setlocale(LC_CTYPE, $currentLocale); + } + } + $im_version = strtolower($gfxConf['im_version_5']); $combineScript = $gfxConf['im_combine_filename'] ? trim($gfxConf['im_combine_filename']) : 'combine'; @@ -78,12 +97,12 @@ // Compile the path & command if ($im_version === 'gm') { $switchCompositeParameters = TRUE; - $path = escapeshellarg($path . 'gm' . $isExt) . ' ' . $command; + $path = $path . 'gm' . $isExt . ' ' . $command; } else { if ($im_version === 'im6') { $switchCompositeParameters = TRUE; } - $path = escapeshellarg($path . (($command == 'composite') ? $combineScript : $command) . $isExt); + $path = $path . (($command == 'composite') ? $combineScript : $command) . $isExt; } // strip profile information for thumbnails and reduce their size