Bug #84178

Cannot create but upload file with "@" in name

Added by Mathias Brodala over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2018-03-08
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In FAL there are at least two different ways to create files which apparently do not apply the same sanitation/validation rules to file names.

This can be verified easily in the Filelist module: if you try to upload a file called everything simply works.

But if you create a file called a ResourceDoesNotExistException is thrown:

#1329647780: Object with identifier "1:/foo@bar.txt" does not exist in storage

When opening the file list once more after this, an error flash message is shown which says File name "" was not allowed!.

This behavior can be traced back to these two code paths:

  • LocalDriver::addFile() calls LocalDriver::sanitizeFileName() which accepts (this is used e.g. for file uploads)
  • LocalDriver::createFile() calls AbstractDriver::isValidFilename() which denies (this is used for everything else)

Related issues

Related to TYPO3 Core - Bug #84079: Error after creating file containing spaces Closed 2018-02-28

Associated revisions

Revision cb905282 (diff)
Added by Wolfgang Klinger over 1 year ago

[BUGFIX] Unify the filename sanitation for upload, create, rename

isValidFilename allows other characters in file names
than sanitizeFileName. This patch sanitizes new file
names automatically (like it’s done for uploads) and
adds a warning for the user about the invalid original
file name for upload, create and rename.

Resolves: #84178
Releases: master, 8.7
Change-Id: I8f5ff6a0c601f0227c40fe7b401eeb15159b29a6
Reviewed-on: https://review.typo3.org/56089
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Mathias Brodala <>
Tested-by: Mathias Brodala <>
Reviewed-by: Frans Saris <>
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

Revision 92b94046 (diff)
Added by Wolfgang Klinger over 1 year ago

[BUGFIX] Unify the filename sanitation for upload, create, rename

isValidFilename allows other characters in file names
than sanitizeFileName. This patch sanitizes new file
names automatically (like it’s done for uploads) and
adds a warning for the user about the invalid original
file name for upload, create and rename.

Resolves: #84178
Releases: master, 8.7
Change-Id: I8f5ff6a0c601f0227c40fe7b401eeb15159b29a6
Reviewed-on: https://review.typo3.org/56352
Tested-by: TYPO3com <>
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56089

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56089

#3 Updated by Wolfgang Klinger over 1 year ago

  • Related to Bug #84079: Error after creating file containing spaces added

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56089

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56089

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56089

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56352

#8 Updated by Wolfgang Klinger over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF