Merge pull request #22561 from nextcloud/backport/22556/stable18

[stable18] 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:27 +02:00 committed by GitHub
commit d6631170ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -280,6 +280,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);