mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Fix copy overwrite for amazon s3
This commit is contained in:
parent
3b08b3fad4
commit
11ac9ce28b
1 changed files with 4 additions and 12 deletions
|
|
@ -473,8 +473,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
if ($this->file_exists($path2)) {
|
||||
return false;
|
||||
if ($this->is_dir($path2)) {
|
||||
$this->rmdir($path2);
|
||||
} else if ($this->file_exists($path2)) {
|
||||
$this->unlink($path2);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -511,11 +513,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
$path2 = $this->normalizePath($path2);
|
||||
|
||||
if ($this->is_file($path1)) {
|
||||
if ($this->is_dir($path2)) {
|
||||
$this->rmdir($path2);
|
||||
} else if ($this->file_exists($path2)) {
|
||||
$this->unlink($path2);
|
||||
}
|
||||
|
||||
if ($this->copy($path1, $path2) === false) {
|
||||
return false;
|
||||
|
|
@ -526,11 +523,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
if ($this->is_dir($path2)) {
|
||||
$this->rmdir($path2);
|
||||
} else if ($this->file_exists($path2)) {
|
||||
$this->unlink($path2);
|
||||
}
|
||||
|
||||
if ($this->copy($path1, $path2) === false) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue