[Pkg-owncloud-commits] [owncloud] 16/205: Verify if path exists

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 17:36:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 2d648ed0eb301ed35db568071325bdc7e0428eb9
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 7685cda..fff1a60 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -63,6 +63,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