summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-26 16:32:44 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-26 16:32:44 +0100
commit30e086fb530c1c0d951fe58266cd5aed21fd91be (patch)
tree087ace540916ff3a7aa1727827461f7ed1f2b131 /apps/files_external
parent2653d914d96e40541378d40c0e6c7589c789f401 (diff)
downloadnextcloud-server-30e086fb530c1c0d951fe58266cd5aed21fd91be.tar.gz
nextcloud-server-30e086fb530c1c0d951fe58266cd5aed21fd91be.zip
Fixed SFTP storage to overwrite on rename
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/sftp.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index bcc4c5eafd5..95e0cefa398 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -285,6 +285,9 @@ class SFTP extends \OC\Files\Storage\Common {
public function rename($source, $target) {
try {
+ if (!$this->is_dir($target) && $this->file_exists($target)) {
+ $this->unlink($target);
+ }
return $this->client->rename(
$this->absPath($source),
$this->absPath($target)