Project

General

Profile

Bug #24281 » 16656.patch

Administrator Admin, 2010-12-14 08:05

View differences:

t3lib/class.t3lib_div.php (working copy)
}
$path = self::fixWindowsFilePath($path);
$prefixCommand = self::prefixCommandLine($path);
$im_version = strtolower($gfxConf['im_version_5']);
$combineScript = $gfxConf['im_combine_filename'] ? trim($gfxConf['im_combine_filename']) : 'combine';
......
$cmdLine = $path . ' ' . implode(' ', $paramsArr);
}
return $cmdLine;
return $prefixCommand . $cmdLine;
}
/**
* Builds prefix for command line calls in Windows
*
* When using a call to a command line function in Windows and PHP < 5.3.0 and if there are more than two double quotes in
* the command will simply not work due to a bug in PHP. A workaround is to add a dummy command in front of the actual
* command
*
* @static
* @param string $path Path to command
* @return string Prefix for command
*/
protected static function prefixCommandLine($path) {
$prefixCommand = '';
if (TYPO3_OS == 'WIN' && version_compare(phpversion(), '5.3.0') == -1) {
if (preg_match('/([a-z]:)/i', $path, $matches)) {
// if a drive letter is found, use it
$prefixCommand = $matches[1] . ' & ';
} else {
// fallback is drive c:, which should be present in Windows installations
$prefixCommand = 'c: & ';
}
}
return $prefixCommand;
}
/**
* Explode a string (normally a list of filenames) with whitespaces by considering quotes in that string. This is mostly needed by the imageMagickCommand function above.
*
* @param string The whole parameters string
(1-1/3)