Skip to content

Commit b2b655f

Browse files
committed
fixup! Restrict query when searching for versions of trashbin files
1 parent 901b018 commit b2b655f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/files_trashbin/lib/Trashbin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,11 @@ private static function getVersionsFromTrash($filename, $timestamp, $user) {
918918
$view = new View('/' . $user . '/files_trashbin/versions');
919919
$versions = [];
920920

921+
/** @var \OC\Files\Storage\Storage $storage */
922+
[$storage,] = $view->resolvePath('/');
923+
921924
//force rescan of versions, local storage may not have updated the cache
922925
if (!self::$scannedVersions) {
923-
/** @var \OC\Files\Storage\Storage $storage */
924-
[$storage,] = $view->resolvePath('/');
925926
$storage->getScanner()->scan('files_trashbin/versions');
926927
self::$scannedVersions = true;
927928
}
@@ -961,11 +962,10 @@ private static function getVersionsFromTrash($filename, $timestamp, $user) {
961962
foreach ($matches as $ma) {
962963
if ($timestamp) {
963964
$parts = explode('.v', substr($ma['path'], 0, $offset));
964-
$versions[] = end($parts);
965965
} else {
966966
$parts = explode('.v', $ma['path']);
967-
$versions[] = end($parts);
968967
}
968+
$versions[] = end($parts);
969969
}
970970
}
971971
return $versions;

0 commit comments

Comments
 (0)