Skip to content

Commit

Permalink
Merge pull request #26271 from nextcloud/backport/26270/stable21
Browse files Browse the repository at this point in the history
[stable21] Catch invalid cache source storage path
  • Loading branch information
MorrisJobke authored Mar 24, 2021
2 parents ef273fe + e9fafce commit e5dc0b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,10 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
$targetPath = $this->normalize($targetPath);

$sourceData = $sourceCache->get($sourcePath);
if ($sourceData === false) {
throw new \Exception('Invalid source storage path: ' . $sourcePath);
}

$sourceId = $sourceData['fileid'];
$newParentId = $this->getParentId($targetPath);

Expand Down

0 comments on commit e5dc0b7

Please sign in to comment.