diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-23 19:30:32 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-23 19:30:32 +0200 |
commit | aeb516c3c9d8c21231ffb91233407c1e0043c625 (patch) | |
tree | aa6360bbe820f3adb374eb821ffec17c7e654f94 | |
parent | 75e45ac78653198fc2575c39c533dc27c3003a0e (diff) | |
download | nextcloud-server-aeb516c3c9d8c21231ffb91233407c1e0043c625.tar.gz nextcloud-server-aeb516c3c9d8c21231ffb91233407c1e0043c625.zip |
Check for blacklisted characters
Fixes https://github.com/owncloud/core/issues/11264
(This should in future get moved to the mountpoint class - but that is something for @icewind1991 ;-))
-rw-r--r-- | apps/files_sharing/ajax/external.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index 544a97e80be..6d68b5f7f82 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -24,6 +24,12 @@ $owner = $_POST['owner']; $name = $_POST['name']; $password = $_POST['password']; +// Check for invalid name +if(!\OCP\Util::isValidFileName($name)) { + \OCP\JSON::error(array('data' => array('message' => $l->t('The mountpoint name contains invalid characters.')))); + exit(); +} + $externalManager = new \OCA\Files_Sharing\External\Manager( \OC::$server->getDatabaseConnection(), \OC\Files\Filesystem::getMountManager(), |