Skip to content
Snippets Groups Projects
Commit 761ba344 authored by Vincent Petry's avatar Vincent Petry
Browse files

Double slash for SMB storage id for compatibility

parent 6ada1e32
No related branches found
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