Bug #88163
closedInvalidArgumentException on uploading file starting with umlauts
0%
Description
If you upload a file starting with an umlaut, e.g.
"ällgemeines Döküment.txt"
to a TYPO3 instance using UTF8filesystem = true
this leads to an error although the file was uploaded
and an exception on accessing the folder the file was uploaded to
This seems to be the case due to TYPO3 stripping the leading umlauts when processing the file for FAL but keeping them in the uploaded file stored in the folder.
Files
Updated by Frans Saris over 5 years ago
For me it doesn't break in TYPO3 8 but in TYPO3 9 it does
Updated by Frans Saris over 5 years ago
- File screenshot.png screenshot.png added
if you look at the stacktrace you see that de fileIndentifier is somewhere trimmed. The first char is removed
Updated by Christian Eßl about 5 years ago
- Is Regression changed from Yes to No
The problem lies in PHPs function basename() which is used in the PathUtility:
public static function basename($path)
{
$currentLocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']);
$basename = basename($path);
setlocale(LC_CTYPE, $currentLocale);
return $basename;
}
If your locale is not set to UTF-8, basename() will return an empty string on filenames that start with an umlaut.
To fix this behaviour, set your systemLocale in TYPO3 to some string with UTF-8.
Example:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] = 'en_US.UTF-8';
Updated by Christian Eßl about 5 years ago
- Related to Task #89351: Warn in [SYS][UTF8filesystem] that a valid UTF-8 locale is necessary added
Updated by Stephan Großberndt about 5 years ago
- Status changed from New to Needs Feedback
- Is Regression changed from No to Yes
I reported it for TYPO3 9.5.5 - now I tested again on a TYPO3 8.7.27 and TYPO3 9.5.9
Both have (and had) the same settings:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem] = true; $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] = 'de_DE.UTF-8';
I can no longer reproduce the issue, maybe it was solved in between? Frans, could you please confirm the issue is no longer there for you too?
Updated by Stephan Großberndt about 5 years ago
- Status changed from Needs Feedback to Closed