Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 9861) +++ t3lib/class.t3lib_div.php (revision ) @@ -6235,8 +6235,8 @@ $cmdLine = $path . ' ' . implode(' ', $paramsArr); } - - return $cmdLine; + // Windows need wrap into double quotes, see http://bugs.typo3.org/view.php?id=13750 for details + return TYPO3_OS === 'WIN' ? '"' . $cmdLine . '"' : $cmdLine; } /** @@ -6254,14 +6254,13 @@ if ($quoteActive > -1) { $paramsArr[$quoteActive] .= ' ' . $v; unset($paramsArr[$k]); - if (preg_match('/"$/', $v)) { + if (substr($v, -1) === $paramsArr[$quoteActive][0]) { $quoteActive = -1; } - } elseif (!trim($v)) { unset($paramsArr[$k]); // Remove empty elements - } elseif (preg_match('/^"/', $v)) { + } elseif (preg_match('/^(["\'])/', $v) && substr($v, -1) !== $v[0]) { $quoteActive = $k; } } @@ -6269,6 +6268,8 @@ if ($unQuote) { foreach ($paramsArr as $key => &$val) { $val = preg_replace('/(^"|"$)/', '', $val); + $val = preg_replace('/(^\'|\'$)/', '', $val); + } } // return reindexed array @@ -6342,4 +6343,4 @@ } } -?> +?> \ No newline at end of file Index: t3lib/class.t3lib_stdgraphic.php =================================================================== --- t3lib/class.t3lib_stdgraphic.php (revision 9811) +++ t3lib/class.t3lib_stdgraphic.php (revision ) @@ -2632,7 +2632,7 @@ $frame = ''; } - $cmd = t3lib_div::imageMagickCommand('convert', $params . ' ' . $this->wrapFileName($input) . $frame . ' ' . $this->wrapFileName($output)); + $cmd = t3lib_div::imageMagickCommand('convert', $params . ' ' . $this->wrapFileName($input . $frame) . ' ' . $this->wrapFileName($output)); $this->IM_commands[] = array($output, $cmd); $ret = exec($cmd); @@ -2685,14 +2685,12 @@ * @return string $inputName escaped as needed */ protected function wrapFileName($inputName) { - if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { - $currentLocale = setlocale(LC_CTYPE, 0); - setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']); - } - $escapedInputName = escapeshellarg($inputName); - if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { - setlocale(LC_CTYPE, $currentLocale); - } + // if safe_mode is enabled PHP will execute escapeshellcmd() + // on the arguments of exec(), system(), passthru() and + // popen() calls + $escapedInputName = t3lib_utility_PhpOptions::isSafeModeEnabled() + ? $inputName + : escapeshellarg($inputName); return $escapedInputName; }