Commit 139fb31d authored by Ralf Zimmermann's avatar Ralf Zimmermann Committed by Christian Kuhn

[BUGFIX] Keep top level upload folder

If a form upload is configured to save files within
"1:/user_upload/test/" (saveToFileMount: '1:/user_upload/test/'),
an upload will be saved within
"1:/user_upload/test/form_<random>/file.png".
Lateron, the DeleteUploadsFinisher delete
"1:/user_upload/test/form_<random>/file.png".
If "1:/user_upload/test/form_<random>/" is emty, this folder will be
deleted too.
This patch prevents the DeleteUploadsFinisher from trying to delete the
top level upload folder "1:/user_upload/test/".

Resolves: #93805
Releases: master, 10.4, 9.5
Change-Id: Ifd2fbf7cf7d5c94186ca27684d1baa92c898ba0f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68636Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 13770c3f
......@@ -70,15 +70,9 @@ class DeleteUploadsFinisher extends AbstractFinisher
protected function deleteEmptyUploadFolders(array $folders): void
{
foreach ($folders as $folder) {
$parentFolder = $folder->getParentFolder();
if ($this->isEmptyFolder($folder)) {
$folder->delete();
}
if ($this->isEmptyFolder($parentFolder)) {
$parentFolder->delete();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment