summaryrefslogtreecommitdiffstats
path: root/apps
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 17:27:33 +0200
commit9dd746489aff35ddec2c195c662e13c25aae350a (patch)
tree2a12059ea96bf463a3cdecd9394ba8b9f8f2b18b /apps
parentac8b748b88931f0191367ad803963d636850909e (diff)
downloadnextcloud-server-9dd746489aff35ddec2c195c662e13c25aae350a.tar.gz
nextcloud-server-9dd746489aff35ddec2c195c662e13c25aae350a.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')
-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 88375f82acb..35fc48aa982 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -51,6 +51,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,