Skip to content

Commit

Permalink
[BUGFIX] Prevent exception in file list
Browse files Browse the repository at this point in the history
When creating a file with a disallowed file
extension an exception was thrown as on creation
the redirect to edit interface on a non-existing
file was called.

Though the better fix might be to prevent the
request for an invalid file to be sent at all
this fix ensures a working file list module in
a more "surgical" way to allow secure backporting.

Resolves: #87527
Releases: master, 9.5, 8.7
Change-Id: I35a054c05b37c09acab83a7aa9eca89cf9ebf6b9
Reviewed-on: https://review.typo3.org/c/59879
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
susannemoog authored and bmack committed Mar 8, 2019
1 parent 0a32354 commit a0bff08
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -104,7 +104,9 @@ public function mainAction(ServerRequestInterface $request): ResponseInterface
if ($request->getParsedBody()['edit'] ?? '') {
/** @var File $file */
$file = $this->fileData['newfile'][0];
$this->redirect = $this->getFileEditRedirect($file) ?? $this->redirect;
if ($file !== null) {
$this->redirect = $this->getFileEditRedirect($file) ?? $this->redirect;
}
}
if ($this->redirect) {
return new RedirectResponse(
Expand Down

0 comments on commit a0bff08

Please sign in to comment.