Skip to content

Commit

Permalink
feat: [WebDAV] prevent WebDAV Adapter from deleting directories when …
Browse files Browse the repository at this point in the history
…using delete
  • Loading branch information
tinect committed Dec 27, 2023
1 parent cbcde25 commit ccf54b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/WebDAV/WebDAVAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ public function readStream(string $path)

public function delete(string $path): void
{
$fileExists = $this->fileExists($path);

if ($fileExists === false) {
if ($this->directoryExists($path)) {
throw UnableToDeleteFile::atLocation($path);
}

return;
}

$location = $this->encodePath($this->prefixer->prefixPath($path));

try {
Expand Down

0 comments on commit ccf54b9

Please sign in to comment.