From 5e28ed6962b8d0a0aedea289ef2014a64d359709 Mon Sep 17 00:00:00 2001 From: Nicolas Frandeboeuf Date: Wed, 5 Feb 2025 19:53:24 +0100 Subject: [PATCH] Fix WebDAVAdapter createDirectory (fix #1689) --- src/WebDAV/WebDAVAdapter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WebDAV/WebDAVAdapter.php b/src/WebDAV/WebDAVAdapter.php index ac5f08e03..829293147 100644 --- a/src/WebDAV/WebDAVAdapter.php +++ b/src/WebDAV/WebDAVAdapter.php @@ -216,14 +216,14 @@ public function createDirectory(string $path, Config $config): void foreach ($parts as $directory) { if ($directory === '.' || $directory === '') { - return; + continue; } $directoryParts[] = $directory; $directoryPath = implode('/', $directoryParts); - $location = $this->encodePath($directoryPath) . '/'; + $location = '/' . $this->encodePath($directoryPath) . '/'; - if ($this->directoryExists($this->prefixer->stripDirectoryPrefix($directoryPath))) { + if ($this->directoryExists($this->prefixer->stripDirectoryPrefix($location))) { continue; }