]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(files): Try to create dir only if it not exists
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>
Tue, 21 May 2024 07:38:47 +0000 (09:38 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 30 May 2024 18:29:20 +0000 (18:29 +0000)
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
lib/private/Files/Node/Folder.php

index 52e7b55676a5625d80bf3e51817a9460384d9dd1..cecc6d39a09fb752af1e8415dec21f5ece689ac2 100644 (file)
@@ -158,7 +158,7 @@ class Folder extends Node implements \OCP\Files\Folder {
                        $fullPath = $this->getFullPath($path);
                        $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
                        $this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]);
-                       if (!$this->view->mkdir($fullPath)) {
+                       if (!$this->view->is_dir($fullPath) && !$this->view->mkdir($fullPath)) {
                                throw new NotPermittedException('Could not create folder "' . $fullPath . '"');
                        }
                        $parent = dirname($fullPath) === $this->getPath() ? $this : null;