diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-04-20 11:20:20 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-04-20 11:20:20 +0200 |
commit | 8398762d78c84119b08c533da39d3d4ac69380d7 (patch) | |
tree | 24b7c71eeb20c849cf8c576caa839b32b6c129e2 /lib | |
parent | 8ef920fdf90bc54d6f17134ebd80a71db2f9d8ea (diff) | |
download | nextcloud-server-8398762d78c84119b08c533da39d3d4ac69380d7.tar.gz nextcloud-server-8398762d78c84119b08c533da39d3d4ac69380d7.zip |
Fail when creating new files with an empty path
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 7b1eff47cd5..14b663d4e16 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -190,6 +190,9 @@ class Folder extends Node implements \OCP\Files\Folder { * @throws \OCP\Files\NotPermittedException */ public function newFile($path, $content = null) { + if (empty($path)) { + throw new NotPermittedException('Could not create as provided path is empty'); + } if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) { $fullPath = $this->getFullPath($path); $nonExisting = new NonExistingFile($this->root, $this->view, $fullPath); |