[Pkg-owncloud-commits] [owncloud] 08/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 0a35d65b5deed63c31564ec0d853578fa4ff8b6e
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 a2ec88f..c73af20 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -45,6 +45,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