aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-10-01 22:29:33 +0200
committerRobin Appelman <icewind@owncloud.com>2013-10-01 22:29:33 +0200
commitea566868a8c0ce7da49fceb29a9d22b46034d642 (patch)
treec8ec02c23f9754e9bb912ba944cc776a01276b9f /apps
parentea6115bfaa6f8598da727dfacbcf093578149d9d (diff)
downloadnextcloud-server-ea566868a8c0ce7da49fceb29a9d22b46034d642.tar.gz
nextcloud-server-ea566868a8c0ce7da49fceb29a9d22b46034d642.zip
return the correct result when doing an smb rename
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/3rdparty/smb4php/smb.php3
-rw-r--r--apps/files_external/tests/smb.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index aec181a3509..e91b0a59581 100644
--- a/apps/files_external/3rdparty/smb4php/smb.php
+++ b/apps/files_external/3rdparty/smb4php/smb.php
@@ -307,7 +307,8 @@ class smb {
trigger_error('rename(): error in URL', E_USER_ERROR);
}
smb::clearstatcache ($url_from);
- return smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
+ $result = smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
+ return $result !== false;
}
function mkdir ($url, $mode, $options) {
diff --git a/apps/files_external/tests/smb.php b/apps/files_external/tests/smb.php
index ca2a93c8944..86dbd3ab88d 100644
--- a/apps/files_external/tests/smb.php
+++ b/apps/files_external/tests/smb.php
@@ -15,7 +15,7 @@ class SMB extends Storage {
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
- if ( ! is_array($this->config) or ! isset($this->config['smb']) or ! $this->config['smb']['run']) {
+ if (!is_array($this->config) or !isset($this->config['smb']) or !$this->config['smb']['run']) {
$this->markTestSkipped('Samba backend not configured');
}
$this->config['smb']['root'] .= $id; //make sure we have an new empty folder to work in
@@ -28,4 +28,10 @@ class SMB extends Storage {
\OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
+
+ public function testRenameWithSpaces() {
+ $this->instance->mkdir('with spaces');
+ $result = $this->instance->rename('with spaces', 'foo bar');
+ $this->assertTrue($result);
+ }
}