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 ;-))
This commit is contained in:
Lukas Reschke 2014-09-23 19:30:32 +02:00
parent 75e45ac786
commit aeb516c3c9

View file

@ -24,6 +24,12 @@ $owner = $_POST['owner'];
$name = $_POST['name']; $name = $_POST['name'];
$password = $_POST['password']; $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( $externalManager = new \OCA\Files_Sharing\External\Manager(
\OC::$server->getDatabaseConnection(), \OC::$server->getDatabaseConnection(),
\OC\Files\Filesystem::getMountManager(), \OC\Files\Filesystem::getMountManager(),