diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-06-17 16:59:24 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-06-17 16:59:24 +0200 |
commit | f2b7eb85c8215566d5e1fb8012b6d860d547ddd5 (patch) | |
tree | 8b3036b6c2fb53aad66d30f3c0803c14eb350496 | |
parent | 448ee4e7a92e96a6a57e52384193342c7987de9f (diff) | |
parent | 1fc8afef1e92c6ba5ecf28d5d06df16b876ba0cd (diff) | |
download | nextcloud-server-f2b7eb85c8215566d5e1fb8012b6d860d547ddd5.tar.gz nextcloud-server-f2b7eb85c8215566d5e1fb8012b6d860d547ddd5.zip |
Merge pull request #16991 from owncloud/stable7-verify-if-path-exists
[stable7] 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 f5343a7ef26..bf30f7fa179 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -46,6 +46,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; |