Project

General

Profile

Actions

Bug #92957

closed

Exception in FileDumpController when trying to download a missing or deleted file using /index.php?eID=dumpFile

Added by Stephan Großberndt over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Must have
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2020-11-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Yes
Sprint Focus:

Description

When trying to download a file using /index.php?eID=dumpFile which is not there (missing or deleted) an exception occurs which leads to HTTP 500 instead of 404:

Core: Exception handler (WEB): 
Uncaught TYPO3 Exception:
Argument 1 passed to TYPO3\CMS\Core\Controller\FileDumpController::isFileValid() must implement interface TYPO3\CMS\Core\Resource\FileInterface, null given,
called in /typo3_src-9.5.23/typo3/sysext/core/Classes/Controller/FileDumpController.php on line 67
TypeError thrown in file /typo3_src-9.5.23/typo3/sysext/core/Classes/Controller/FileDumpController.php in line 114.
Requested URL: https://example.org/index.php?eID=dumpFile&t=f&f=4711&token=--AnonymizedToken--&download=

This happens because $file is set to NULL and then passed to isFileValid() which expects $file not to be NULL:

if ($file->isDeleted() || $file->isMissing()) {
  $file = null;
}
if (!$this->isFileValid($file)) {
  $file = null;
}

This is a regression of #91754 / https://review.typo3.org/c/Packages/TYPO3.CMS/+/65126

Actions

Also available in: Atom PDF