From ebb55236982ea5a30b08dbbeb98c32c059db3807 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 18 Jun 2015 16:48:32 +0200 Subject: 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(+) (limited to 'apps/files') diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 4d5dc84e9c7..debdf26ffdf 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -83,6 +83,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, -- cgit v1.2.3