diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-17 15:06:50 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-17 15:08:09 +0200 |
commit | dead1acba822cdc2d0b80e29c5559ba158f537ec (patch) | |
tree | 14955af0fbc020531b38db9f71daa700477624e2 | |
parent | 6ea7e89649896763b0f8bb927cadee3f38eb3a36 (diff) | |
download | nextcloud-server-dead1acba822cdc2d0b80e29c5559ba158f537ec.tar.gz nextcloud-server-dead1acba822cdc2d0b80e29c5559ba158f537ec.zip |
Verify if path exists
We need to verify if the specified path exists to gracefully prevent errors.
-rw-r--r-- | apps/files_sharing/ajax/publicpreview.php | 5 |
1 files changed, 5 insertions, 0 deletions
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; |