Project

General

Profile

Actions

Bug #88163

closed

InvalidArgumentException on uploading file starting with umlauts

Added by Stephan Großberndt about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-04-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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

Error after uploading the file

and an exception on accessing the folder the file was uploaded to

Exception on accessing the folder containing the file

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

error_after_upload.png (40.2 KB) error_after_upload.png Error after uploading the file Stephan Großberndt, 2019-04-17 11:29
exception_folder_access.png (92.5 KB) exception_folder_access.png Exception on accessing the folder containing the file Stephan Großberndt, 2019-04-17 11:30
screenshot.png (4.72 KB) screenshot.png Frans Saris, 2019-04-17 17:00

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #89351: Warn in [SYS][UTF8filesystem] that a valid UTF-8 locale is necessaryClosed2019-10-05

Actions
Actions #1

Updated by Frans Saris about 5 years ago

For me it doesn't break in TYPO3 8 but in TYPO3 9 it does

Actions #2

Updated by Frans Saris about 5 years ago

if you look at the stacktrace you see that de fileIndentifier is somewhere trimmed. The first char is removed

Actions #3

Updated by Stephan Großberndt about 5 years ago

  • Is Regression set to Yes
Actions #4

Updated by Christian Eßl over 4 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';

Actions #5

Updated by Christian Eßl over 4 years ago

  • Related to Task #89351: Warn in [SYS][UTF8filesystem] that a valid UTF-8 locale is necessary added
Actions #6

Updated by Stephan Großberndt over 4 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?

Actions #7

Updated by Frans Saris over 4 years ago

For me this wasn't a problem

Actions #8

Updated by Stephan Großberndt over 4 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF