mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 03:02:01 -04:00
fix(storage): Try to delete existing target
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
b2464dc43b
commit
85e320bde2
2 changed files with 13 additions and 10 deletions
|
|
@ -106,13 +106,14 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
|
|||
* @return bool
|
||||
*/
|
||||
protected function remove($path) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function is_dir($path) {
|
||||
|
|
|
|||
|
|
@ -380,10 +380,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