diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-18 16:48:32 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-18 16:48:32 +0200 |
commit | ebb55236982ea5a30b08dbbeb98c32c059db3807 (patch) | |
tree | 5a43f231a77ffadd358d36fb18917d64bbeebe6e /apps/files/ajax | |
parent | 7a0917e5b2c25b2d90e503e30a3016dbe06a780c (diff) | |
download | nextcloud-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/ajax')
-rw-r--r-- | apps/files/ajax/upload.php | 4 |
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, |