aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-24 14:33:35 +0100
committerRobin Appelman <robin@icewind.nl>2021-03-24 14:33:35 +0100
commite8184eaaada6bfe373877226e4a1ddfab2b2a1c6 (patch)
tree713d89837442e5933ae3976ce1b655663564e7e3
parentf842608c95a1a38ef59d7951380b73c1e4f0c2a3 (diff)
downloadnextcloud-server-e8184eaaada6bfe373877226e4a1ddfab2b2a1c6.tar.gz
nextcloud-server-e8184eaaada6bfe373877226e4a1ddfab2b2a1c6.zip
proper error for search results outside user folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Search/Result/File.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php
index c3b0c4e3751..f8779f8ccbd 100644
--- a/lib/private/Search/Result/File.php
+++ b/lib/private/Search/Result/File.php
@@ -133,7 +133,11 @@ class File extends \OCP\Search\Result {
$userID = $userSession->getUser()->getUID();
self::$userFolderCache = \OC::$server->getUserFolder($userID);
}
- return self::$userFolderCache->getRelativePath($path);
+ $relativePath = self::$userFolderCache->getRelativePath($path);
+ if ($relativePath === null) {
+ throw new \Exception("Search result not in user folder");
+ }
+ return $relativePath;
}
/**