Project

General

Profile

Bug #24379 ยป 16797.patch

Administrator Admin, 2010-12-21 15:11

View differences:

t3lib/class.t3lib_stdgraphic.php (working copy)
* Escapes a file name so it can safely be used on the command line.
*
* @param string $inputName filename to safeguard, must not be empty
*
* @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']);
// if safe_mode is enabled PHP will execute escapeshellcmd()
// on the arguments of exec(), system(), passthru() and
// popen() calls
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']);
}
$escapedInputName = escapeshellarg($inputName);
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
setlocale(LC_CTYPE, $currentLocale);
}
} else {
$escapedInputName = $inputName;
}
$escapedInputName = escapeshellarg($inputName);
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
setlocale(LC_CTYPE, $currentLocale);
}
return $escapedInputName;
}
    (1-1/1)