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; }