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

David Prévot taffit at moszumanska.debian.org
Tue Jun 23 23:12:23 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 ff2de8439a05e2bcd14b2e2bd57e3c96e39bf774
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Thu Jun 18 16:48:32 2015 +0200

    Verify if path exists
    
    We need to check if the path exists and throw an error instead of handling this situation ungraciously.
---
 apps/files/ajax/upload.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index b737d5f..6e190b0 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -49,6 +49,10 @@ if (empty($_POST['dirToken'])) {
 
 		// The token defines the target directory (security reasons)
 		$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
+		if($path === null) {
+			OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
+			die();
+		}
 		$dir = sprintf(
 			"/%s/%s",
 			$path,

-- 
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