aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-06-18 16:48:32 +0200
committerLukas Reschke <lukas@owncloud.com>2015-06-18 16:48:32 +0200
commitebb55236982ea5a30b08dbbeb98c32c059db3807 (patch)
tree5a43f231a77ffadd358d36fb18917d64bbeebe6e /apps/files
parent7a0917e5b2c25b2d90e503e30a3016dbe06a780c (diff)
downloadnextcloud-server-ebb55236982ea5a30b08dbbeb98c32c059db3807.tar.gz
nextcloud-server-ebb55236982ea5a30b08dbbeb98c32c059db3807.zip
Verify if path exists
We need to check if the path exists and throw an error instead of handling this situation ungraciously.
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/upload.php4
1 files changed, 4 insertions, 0 deletions
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,