diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-11-15 19:50:16 +0100 |
---|---|---|
committer | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-11-20 09:42:33 +0100 |
commit | 8755bf1815f0e7a76603026fa2d99c79abc7b273 (patch) | |
tree | 2dcaac43ccb39c5849db4cc5f37d7120feb5491b /lib/private/Files/Storage/Common.php | |
parent | a4c1a75ee66005f6096461a3cbd2c0c9263ef1ca (diff) | |
download | nextcloud-server-deleteExistingTarget.tar.gz nextcloud-server-deleteExistingTarget.zip |
fix(storage): Try to delete existing targetdeleteExistingTarget
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Add same logic to common storage
Diffstat (limited to 'lib/private/Files/Storage/Common.php')
-rw-r--r-- | lib/private/Files/Storage/Common.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 334ca34294e..8a95e637372 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -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 { |