diff options
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 10 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 20 |
2 files changed, 15 insertions, 15 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index e46f60d0be4..faf51369375 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -435,14 +435,14 @@ class SFTP extends \OC\Files\Storage\Common { /** * {@inheritdoc} */ - public function rename($source, $target) { + public function rename($path1, $path2) { try { - if ($this->file_exists($target)) { - $this->unlink($target); + if ($this->file_exists($path2)) { + $this->unlink($path2); } return $this->getConnection()->rename( - $this->absPath($source), - $this->absPath($target) + $this->absPath($path1), + $this->absPath($path2) ); } catch (\Exception $e) { return false; diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index c7055be3ed8..7e297885ded 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -306,31 +306,31 @@ class SMB extends Common implements INotifyStorage { /** * Rename the files. If the source or the target is the root, the rename won't happen. * - * @param string $source the old name of the path - * @param string $target the new name of the path + * @param string $path1 the old name of the path + * @param string $path2 the new name of the path * @return bool true if the rename is successful, false otherwise */ - public function rename($source, $target, $retry = true) { - if ($this->isRootDir($source) || $this->isRootDir($target)) { + public function rename($path1, $path2, $retry = true) { + if ($this->isRootDir($path1) || $this->isRootDir($path2)) { return false; } - $absoluteSource = $this->buildPath($source); - $absoluteTarget = $this->buildPath($target); + $absoluteSource = $this->buildPath($path1); + $absoluteTarget = $this->buildPath($path2); try { $result = $this->share->rename($absoluteSource, $absoluteTarget); } catch (AlreadyExistsException $e) { if ($retry) { - $this->remove($target); - $result = $this->share->rename($absoluteSource, $absoluteTarget, false); + $this->remove($path2); + $result = $this->share->rename($absoluteSource, $absoluteTarget); } else { $this->logger->logException($e, ['level' => ILogger::WARN]); return false; } } catch (InvalidArgumentException $e) { if ($retry) { - $this->remove($target); - $result = $this->share->rename($absoluteSource, $absoluteTarget, false); + $this->remove($path2); + $result = $this->share->rename($absoluteSource, $absoluteTarget); } else { $this->logger->logException($e, ['level' => ILogger::WARN]); return false; |