From dead1acba822cdc2d0b80e29c5559ba158f537ec Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 17 Jun 2015 15:06:50 +0200 Subject: Verify if path exists We need to verify if the specified path exists to gracefully prevent errors. --- apps/files_sharing/ajax/publicpreview.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index f5343a7ef26..833bd1b4333 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -46,6 +46,11 @@ $view = new \OC\Files\View('/' . $userId . '/files'); $pathId = $linkedItem['file_source']; $path = $view->getPath($pathId); + +if($path === null) { + throw new \OCP\Files\NotFoundException(); +} + $pathInfo = $view->getFileInfo($path); $sharedFile = null; -- cgit v1.2.3