Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonschaufi opened this issue Feb 16, 2025 · 0 comments

Comments

@simonschaufi
Copy link
Collaborator

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

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Breaking-105733-FileNameValidatorNoLongerAcceptsCustomRegexIn__construct.html

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

See 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.

PHP-API, NotScanned, ext:core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant