summaryrefslogtreecommitdiffstats
path: root/lib/private/files/utils/scanner.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/utils/scanner.php')
-rw-r--r--lib/private/files/utils/scanner.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php
index 662d4ac03c7..d04dbd2bd72 100644
--- a/lib/private/files/utils/scanner.php
+++ b/lib/private/files/utils/scanner.php
@@ -115,6 +115,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())) {