diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 08c4b25a0888..88ff44882bd4 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -180,6 +180,21 @@ public function unlink($path) { } } + /** + * @param string $path1 the old name + * @param string $path2 the new name + * @return bool + */ + public function rename($path1, $path2) { + $this->remove($path2); + $path1 = $this->buildPath($path1); + $path2 = $this->buildPath($path2); + $result = $this->share->rename($path1, $path2); + + // non-native Share implementation does not return bool in fact + return is_bool($result) ? $result : true; + } + /** * check if a file or folder has been updated since $time *