proper error for search results outside user folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
f842608c95
commit
e8184eaaad
|
@ -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…
Reference in New Issue