Merge pull request #17922 from owncloud/smb-storageiddoubleslash
Double slash for SMB storage id for compatibility
This commit is contained in:
commit
6f72c37464
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue