Skip to content
Snippets Groups Projects
Commit e2fffcda authored by Julius Härtl's avatar Julius Härtl Committed by backportbot[bot]
Browse files

Fail when creating new files with an empty path


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent 56561856
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment