Skip to content

Commit

Permalink
fix(storage): Try to delete existing target
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored Nov 15, 2024
1 parent a4c1a75 commit e1bc4bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ public function rename(string $source, string $target): bool {
return false;
}

if ($this->is_dir($target)) {
$this->rmdir($target);
} elseif ($this->is_file($target)) {
$this->unlink($target);
if ($this->file_exists($target)) {
if ($this->is_dir($target)) {
$this->rmdir($target);
} elseif ($this->is_file($target)) {
$this->unlink($target);
}
}

if ($this->is_dir($source)) {
Expand Down

0 comments on commit e1bc4bf

Please sign in to comment.