mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
fix(storage): Try to delete existing target
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Add same logic to common storage
This commit is contained in:
parent
a4c1a75ee6
commit
8755bf1815
2 changed files with 15 additions and 10 deletions
|
|
@ -69,13 +69,16 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage,
|
|||
}
|
||||
|
||||
protected function remove(string $path): bool {
|
||||
if ($this->is_dir($path)) {
|
||||
return $this->rmdir($path);
|
||||
} elseif ($this->is_file($path)) {
|
||||
return $this->unlink($path);
|
||||
} else {
|
||||
return false;
|
||||
if ($this->file_exists($path)) {
|
||||
if ($this->is_dir($path)) {
|
||||
return $this->rmdir($path);
|
||||
} elseif ($this->is_file($path)) {
|
||||
return $this->unlink($path);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function is_dir(string $path): bool {
|
||||
|
|
|
|||
|
|
@ -342,10 +342,12 @@ class Local extends \OC\Files\Storage\Common {
|
|||
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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue