diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-05-22 17:26:29 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-05-30 18:30:37 +0000 |
commit | 4df77c6fa1e9fda26c45ed9fa4a53dafe2ea548d (patch) | |
tree | 2186fb8d9ed869d99c09588dfe37ace0cdcfde5e /lib | |
parent | fe459f9d7421ecf34892b6db869687e6039e904e (diff) | |
download | nextcloud-server-4df77c6fa1e9fda26c45ed9fa4a53dafe2ea548d.tar.gz nextcloud-server-4df77c6fa1e9fda26c45ed9fa4a53dafe2ea548d.zip |
Try create folder first and check if it exists after
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index d5281e44387..7eda353d2b2 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -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; |