Bug #45489
closedt3lib_stdGraphic: escaping of filenames does not work when using brackets ()
0%
Description
When you got an image that has brackets () in its filename, resizing (i.e. all ImageMagick actions) won't work. The reason is that the filenames with brackets need to be surrunded by quotes when passed to the IM command. But the quotes are removed (after properly applied).
The code from 4.5.22:
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 escapeshellarg didn't change anything and if there is no whitespace in the original string // keep the original for (partial) safe_mode compatibility if (trim($escapedInputName, '"\'') === $inputName && !preg_match('/[[:space:]]/', $inputName)) { ///////////// remove the next line for bugfix //////////////////////// $escapedInputName = $inputName; } return $escapedInputName; }
Updated by Mathias Schreiber almost 10 years ago
- Status changed from New to Needs Feedback
- Assignee set to Mathias Schreiber
- Is Regression set to No
Is this still the case with FAL?
Updated by David Bruchmann over 9 years ago
Using common fileupload squared and round brackets are removed in Version 6.2.12.
In files uploaded with FTP at least round brackets never make any problems.
Updated by Riccardo De Contardi over 9 years ago
In 6.2.12 I tried to upload a file called
Andrea_[Mantegna]_The_[Court_[of]]]]_Mantua].JPG
And it was renamed to:
Andrea__Mantegna__The__Court__of_____Mantua_.JPG
Do you think it is sufficient to consider this closed? Thank you
Updated by Riccardo De Contardi over 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.