diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2021-04-20 21:47:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 21:47:16 +0300 |
commit | f31d24dd7a076b6b343bf74e2a9e55497fb3a9d2 (patch) | |
tree | 8d18c272d7f26e763dd81f9b5c4b46444c164d10 /lib | |
parent | 85bdf6c0fcbb019d4c039af81581014d7b819436 (diff) | |
parent | 8398762d78c84119b08c533da39d3d4ac69380d7 (diff) |
Merge pull request #26647 from nextcloud/bugfix/noid/empty-filename
Fail when creating new files with an empty path
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); |