diff options
author | Robin Appelman <robin@icewind.nl> | 2021-03-24 14:33:35 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-03-24 14:33:35 +0100 |
commit | e8184eaaada6bfe373877226e4a1ddfab2b2a1c6 (patch) | |
tree | 713d89837442e5933ae3976ce1b655663564e7e3 | |
parent | f842608c95a1a38ef59d7951380b73c1e4f0c2a3 (diff) | |
download | nextcloud-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.php | 6 |
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; } /** |