Issue Bug Closed

#85384verifyFilenameAgainstDenyPattern doesn´t work with UTF-8 strings in Command

Pascal Rinker 06/25/18, 16:17 updated 06/27/18, 09:50

Description

The pattern inside GeneralUtility::verifyFilenameAgainstDenyPattern should have set the u flag to trade pattern and subject as UTF-8.

You can reproduce this problem by adding a symfony command with the following example code inside the execute() method:

$result will be FALSE with the default deny pattern from TYPO3

$result = GeneralUtility::verifyFilenameAgainstDenyPattern('KÖLSCH.jpg');
var_dump($result);

$result will be TRUE with the default deny pattern from TYPO3

$result = GeneralUtility::verifyFilenameAgainstDenyPattern('KOELSCH.jpg');
var_dump($result);

Adding the u flag to the pattern solves the problem.

My test system was macOS 10.13 with PHP 7.2.4 installed via brew.

Reviews 1