Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-04-20 21:47:16 +0300
committerGitHub <noreply@github.com>2021-04-20 21:47:16 +0300
commitf31d24dd7a076b6b343bf74e2a9e55497fb3a9d2 (patch)
tree8d18c272d7f26e763dd81f9b5c4b46444c164d10 /lib
parent85bdf6c0fcbb019d4c039af81581014d7b819436 (diff)
parent8398762d78c84119b08c533da39d3d4ac69380d7 (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.php3
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);