Skip to content
Snippets Groups Projects
Commit 6f72c374 authored by Robin McCorkell's avatar Robin McCorkell
Browse files

Merge pull request #17922 from owncloud/smb-storageiddoubleslash

Double slash for SMB storage id for compatibility
parents c4055af2 761ba344
Branches
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment