Breaking: #105733 - FileNameValidator no longer accepts custom regex in __construct()

See forge#105733

Description

Class \TYPO3\CMS\Core\Resource\Security\FileNameValidator does not handle a custom file deny pattern in __construct() anymore. The service is now stateless and can be injected without side effects.

Impact

A custom partial regex as first constructor argument when instantiating the service is ignored. The service relies on $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] configuration, and a hard coded constant as fallback.

Affected installations

Instances with custom extensions using GeneralUtility::makeInstance(FileNameValidator::class, 'some-custom-pattern'); are affected. This is most likely a very rare case.

Migration

Extensions that need to test with custom patterns that can not be declared globally using $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] should probably switch to an own service implementing the test, or inline the code. The main worker code of the service is just four lines of code.