Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 9243) +++ t3lib/class.t3lib_div.php (working copy) @@ -6009,19 +6009,22 @@ if($quoteActive > -1) { $paramsArr[$quoteActive] .= ' '.$v; unset($paramsArr[$k]); - if(preg_match('/"$/', $v)) { $quoteActive = -1; } + 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; } } if($unQuote) { foreach ($paramsArr as $key => &$val) { - $val = preg_replace('/(^"|"$)/','',$val); + $val = preg_replace('/(^"|"$)/', '', $val); + $val = preg_replace('/(^\'|\'$)/', '', $val); } } // return reindexed array @@ -6091,4 +6094,4 @@ } } -?> +?> \ No newline at end of file Index: t3lib/class.t3lib_stdgraphic.php =================================================================== --- t3lib/class.t3lib_stdgraphic.php (revision 9243) +++ t3lib/class.t3lib_stdgraphic.php (working copy) @@ -2707,7 +2707,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); @@ -2760,7 +2760,13 @@ * @return string $inputName escaped as needed */ protected function wrapFileName($inputName) { - return escapeshellarg($inputName); + // 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; }