[Pkg-owncloud-commits] [owncloud] 05/10: Verify if path exists
David Prévot
taffit at moszumanska.debian.org
Tue Jun 23 23:39:28 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v6.0.9beta
in repository owncloud.
commit 7ee4acdf57ea553dd6d52d445a1c4cb0f589b59f
Author: Lukas Reschke <lukas at owncloud.com>
Date: Wed Jun 17 15:06:50 2015 +0200
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 a52f522..d688ceb 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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list