Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-19 20:11:13 +0300
committerRobin Appelman <robin@icewind.nl>2021-03-31 17:42:19 +0300
commit34037ef1957cb9eafd47bdc30195ff242c9a78f2 (patch)
treef215a6bd74fa9ee663164e832517353e9e192116
parent312f804b0edb8bd126680fe76bdb22ad9a71a276 (diff)
harden getTrashNodeById a bitharden-trashnode
hopefully prevent some error cases Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/Trash/TrashBackend.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php
index f32cd72c..58d8553e 100644
--- a/lib/Trash/TrashBackend.php
+++ b/lib/Trash/TrashBackend.php
@@ -307,7 +307,10 @@ class TrashBackend implements ITrashBackend {
}
$absolutePath = $this->appFolder->getMountPoint()->getMountPoint() . $path;
$relativePath = $trashFolder->getRelativePath($absolutePath);
- list(, $folderId, $nameAndTime) = explode('/', $relativePath);
+ if (!$relativePath || strpos($relativePath, '/') === false) {
+ return null;
+ }
+ list(, $folderId) = explode('/', $relativePath);
$trashItem = $this->trashManager->getTrashItemByFileId($fileId);
$originalPath = $folderId . '/' . ($trashItem ? $trashItem['original_location'] : '/');
if ($this->userHasAccessToFolder($user, (int)$folderId) && $this->userHasAccessToPath($user, $originalPath)) {