Merge pull request #22560 from nextcloud/backport/22556/stable19

[stable19] Do not keep the part file if the forbidden exception has no retry set
This commit is contained in:
Roeland Jago Douma 2020-09-03 21:06:11 +02:00 committed by GitHub
commit 468f1fc592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -288,6 +288,9 @@ class File extends Node implements IFile {
throw new Exception('Could not rename part file to final file');
}
} catch (ForbiddenException $ex) {
if (!$ex->getRetry()) {
$partStorage->unlink($internalPartPath);
}
throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry());
} catch (\Exception $e) {
$partStorage->unlink($internalPartPath);