Skip to content

Commit

Permalink
[BUGFIX] Prevent calling isFileValid with null
Browse files Browse the repository at this point in the history
Resolves: #93997
Releases: master
Change-Id: Idf0591125371cc25f53b8c9cc178a5c595c7be2d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68887
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
ervaude authored and lolli42 committed Apr 27, 2021
1 parent c381b47 commit 9cbec07
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions phpstan.neon
Expand Up @@ -246,10 +246,6 @@ parameters:
message: "#^Parameter \\#1 \\$manifest of method TYPO3\\\\CMS\\\\Core\\\\Core\\\\ClassLoadingInformationGenerator\\:\\:getAutoloadSectionFromManifest\\(\\) expects stdClass, object given\\.$#"
count: 2
path: typo3/sysext/core/Classes/Core/ClassLoadingInformationGenerator.php
-
message: "#^Parameter \\#1 \\$file of method TYPO3\\\\CMS\\\\Core\\\\Controller\\\\FileDumpController\\:\\:isFileValid\\(\\) expects TYPO3\\\\CMS\\\\Core\\\\Resource\\\\FileInterface, TYPO3\\\\CMS\\\\Core\\\\Resource\\\\File\\|null given\\.$#"
count: 1
path: typo3/sysext/core/Classes/Controller/FileDumpController.php
-
message: "#^Parameter \\#2 \\$callback of function array_walk expects callable\\(\\)\\: mixed, array\\(\\$this\\(TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Backend\\\\AbstractBackend\\), 'flushByTag'\\) given\\.$#"
count: 1
Expand Down
3 changes: 1 addition & 2 deletions typo3/sysext/core/Classes/Controller/FileDumpController.php
Expand Up @@ -182,8 +182,7 @@ protected function createFileObjectByParameters(array $parameters)
$file = $this->resourceFactory->getFileObject($parameters['f']);
if ($file->isDeleted() || $file->isMissing()) {
$file = null;
}
if (!$this->isFileValid($file)) {
} elseif (!$this->isFileValid($file)) {
$file = null;
}
} catch (\Exception $e) {
Expand Down

0 comments on commit 9cbec07

Please sign in to comment.