diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-08-01 15:05:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-09-17 15:52:00 +0200 |
commit | 11ac9ce28b1bd9624485a0e197803a61b41d4a29 (patch) | |
tree | 6776912a25abaf0040043c2cb12fc0bd9cb0f799 | |
parent | 3b08b3fad4729549a01679ca2c9e8d33234a58bf (diff) | |
download | nextcloud-server-11ac9ce28b1bd9624485a0e197803a61b41d4a29.tar.gz nextcloud-server-11ac9ce28b1bd9624485a0e197803a61b41d4a29.zip |
Fix copy overwrite for amazon s3
-rw-r--r-- | apps/files_external/lib/amazons3.php | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index d9e3ef05265..9daac83e066 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -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; |