#65673"0" is not accepted as a valid file name
Description
After sanitizing a filename in LocalDriver, the result $cleanFilename is checked for … any surviving characters, I guess?
Line 320-325, typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php:
if (!$cleanFileName) {
throw new \TYPO3\CMS\Core\Resource\Exception\InvalidFileNameException(
'File name ' . $cleanFileName . ' is invalid.',
1320288991
);
}
The purpose of the error message is not quite clear; either $cleanFileName is empty since the file name did not contain any valid characters to begin with, or it is NULL as a return value of preg_replace when the function encountered an error.
The check, however, catches any file name that evaluates to false after coercion (although the file name is perfectly valid).
Without any deeper understanding, I propose to change the condition to
if (is_null($cleanFileName) || empty($cleanFileName)) {
Discuss!