diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-18 10:05:12 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-18 10:05:12 +0200 |
commit | 8d4f918671266b0b0457335f6fa56eb23841ae04 (patch) | |
tree | 4d83bf2a9ea15390baa7ab6710656eaa4fd74b14 | |
parent | c4cb34da9d17af53f77f91cb40bdcf56a89abf0c (diff) | |
parent | 414896d8a095d93ebd4d8cd76981392c7b19f9a2 (diff) | |
download | nextcloud-server-8d4f918671266b0b0457335f6fa56eb23841ae04.tar.gz nextcloud-server-8d4f918671266b0b0457335f6fa56eb23841ae04.zip |
Merge pull request #16993 from owncloud/verify-if-path-exists
[master] Verify if path exists
-rw-r--r-- | apps/files_sharing/ajax/publicpreview.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 7685cda9d71..0734c8c1159 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -63,6 +63,13 @@ $view = new \OC\Files\View('/' . $userId . '/files'); $pathId = $linkedItem['file_source']; $path = $view->getPath($pathId); + +if($path === null) { + \OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND); + \OC_Log::write('core-preview', 'Could not resolve file for shared item', OC_Log::WARN); + exit; +} + $pathInfo = $view->getFileInfo($path); $sharedFile = null; |