Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fail when creating new files with an empty path
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Apr 20, 2021
commit 8398762d78c84119b08c533da39d3d4ac69380d7
3 changes: 3 additions & 0 deletions lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ public function newFolder($path) {
* @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);
Expand Down