Task #39928

Central function to correctly (locale-aware) escape filenames and shell-args

Added by Stefan Neufeind 9 months ago. Updated 9 months ago.

Status:Accepted Start date:2012-08-18
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
TYPO3 Version:4.5 Complexity:easy
PHP Version:
Votes: 0

Description

The functionality below appears in 3 places in core currently (and one more currently under review).
We should add a central function for that (t3lib_div? hmm ...)

Appears in:
t3lib/class.t3lib_stdgraphic.php
t3lib/thumbs.php
t3lib/file/Service/FileProcessingService.php

And patch for review at: https://review.typo3.org/9177 (feature for 6.0 possibly, feature #34227)

Taken from: t3lib/class.t3lib_stdgraphic.php
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);
}
return $escapedInputName;
}


Related issues

related to Core - Feature #34227: Scheduler: Allow execution using "at"-daemon Resolved 2012-02-24

History

Updated by Michael Stucki 9 months ago

  • Status changed from New to Accepted
  • Complexity set to easy

Also available in: Atom PDF