[Pkg-owncloud-commits] [owncloud] 17/36: Verify if path exists

David Prévot taffit at moszumanska.debian.org
Tue Jun 23 23:12:22 UTC 2015


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

taffit pushed a commit to branch master
in repository owncloud.

commit f4bc29a1e77cee3fdaf913a20b55fabc14675e26
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 f5343a7..833bd1b 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