Skip to content

Commit 97b9e8f

Browse files
authored
Merge pull request #26808 from nextcloud/backport/26647/stable21
[stable21] Fail when creating new files with an empty path
2 parents 5656185 + e2fffcd commit 97b9e8f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/private/Files/Node/Folder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ public function newFolder($path) {
190190
* @throws \OCP\Files\NotPermittedException
191191
*/
192192
public function newFile($path, $content = null) {
193+
if (empty($path)) {
194+
throw new NotPermittedException('Could not create as provided path is empty');
195+
}
193196
if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) {
194197
$fullPath = $this->getFullPath($path);
195198
$nonExisting = new NonExistingFile($this->root, $this->view, $fullPath);

0 commit comments

Comments
 (0)