]> source.dussan.org Git - nextcloud-server.git/commitdiff
Try create folder first and check if it exists after 45590/head
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>
Wed, 22 May 2024 15:26:29 +0000 (17:26 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 30 May 2024 18:29:20 +0000 (18:29 +0000)
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
lib/private/Files/Node/Folder.php

index cecc6d39a09fb752af1e8415dec21f5ece689ac2..73e7377c26bfdf73088cc1e14c06693a34345d4d 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->is_dir($fullPath) && !$this->view->mkdir($fullPath)) {
+                       if (!$this->view->mkdir($fullPath) && !$this->view->is_dir($fullPath)) {
                                throw new NotPermittedException('Could not create folder "' . $fullPath . '"');
                        }
                        $parent = dirname($fullPath) === $this->getPath() ? $this : null;