check if the user is trying to scan a valid path

This commit is contained in:
Robin Appelman 2015-07-26 19:13:31 +02:00 committed by Lukas Reschke
parent 4edfadac96
commit f74525c349

View file

@ -131,6 +131,9 @@ class Scanner extends PublicEmitter {
* @throws \OC\ForbiddenException
*/
public function scan($dir = '') {
if (!Filesystem::isValidPath($dir)) {
throw new \InvalidArgumentException('Invalid path to scan');
}
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
if (is_null($mount->getStorage())) {