Browse Source

proper error for search results outside user folder

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/26219/head
Robin Appelman 5 years ago
parent
commit
e8184eaaad
No known key found for this signature in database GPG Key ID: 42B69D8A64526EFB
  1. 6
      lib/private/Search/Result/File.php

6
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;
}
/**

Loading…
Cancel
Save