diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-07-28 19:54:11 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-07-28 19:54:11 +0100 |
commit | 6f72c3746403cdba5dbaae9a21870f0db0e5226e (patch) | |
tree | 1a1bf07d658c5a57ff9fa70f8ab802c96bb4a13b /apps | |
parent | c4055af20b59b960d7c6e8434f2baa320eea574f (diff) | |
parent | 761ba344b786eb913ba41f4382315e8f75a51d2d (diff) | |
download | nextcloud-server-6f72c3746403cdba5dbaae9a21870f0db0e5226e.tar.gz nextcloud-server-6f72c3746403cdba5dbaae9a21870f0db0e5226e.zip |
Merge pull request #17922 from owncloud/smb-storageiddoubleslash
Double slash for SMB storage id for compatibility
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/smb.php | 5 | ||||
-rw-r--r-- | apps/files_external/tests/backends/smb.php | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 4a2eebf20b1..f58cd9849f2 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -78,7 +78,10 @@ class SMB extends Common { * @return string */ public function getId() { - return 'smb::' . $this->server->getUser() . '@' . $this->server->getHost() . '/' . $this->share->getName() . '/' . $this->root; + // FIXME: double slash to keep compatible with the old storage ids, + // failure to do so will lead to creation of a new storage id and + // loss of shares from the storage + return 'smb::' . $this->server->getUser() . '@' . $this->server->getHost() . '//' . $this->share->getName() . '/' . $this->root; } /** diff --git a/apps/files_external/tests/backends/smb.php b/apps/files_external/tests/backends/smb.php index 9e60a9e06e0..0da86cb824f 100644 --- a/apps/files_external/tests/backends/smb.php +++ b/apps/files_external/tests/backends/smb.php @@ -61,4 +61,16 @@ class SMB extends Storage { $this->assertTrue($result); $this->assertTrue($this->instance->is_dir('foo bar')); } + + public function testStorageId() { + $this->instance = new \OC\Files\Storage\SMB([ + 'host' => 'testhost', + 'user' => 'testuser', + 'password' => 'somepass', + 'share' => 'someshare', + 'root' => 'someroot', + ]); + $this->assertEquals('smb::testuser@testhost//someshare//someroot/', $this->instance->getId()); + $this->instance = null; + } } |