Merge pull request #14998 from rullzer/ocs_api_new_url
OCS API should return fancy OC url
This commit is contained in:
commit
2370af62ea
2 changed files with 6 additions and 2 deletions
|
@ -303,8 +303,7 @@ class Local {
|
|||
break;
|
||||
}
|
||||
}
|
||||
$url = \OCP\Util::linkToPublic('files&t='.$token);
|
||||
$data['url'] = $url; // '&' gets encoded to $amp;
|
||||
$data['url'] = \OC::$server->getURLGenerator()->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $token]);
|
||||
$data['token'] = $token;
|
||||
|
||||
} else {
|
||||
|
|
|
@ -103,6 +103,11 @@ class Test_Files_Sharing_Api extends TestCase {
|
|||
// check if we have a token
|
||||
$this->assertTrue(is_string($data['token']));
|
||||
|
||||
// check for correct link
|
||||
$url = \OC::$server->getURLGenerator()->getAbsoluteURL('/index.php/s/' . $data['token']);
|
||||
$this->assertEquals($url, $data['url']);
|
||||
|
||||
|
||||
$share = $this->getShareFromId($data['id']);
|
||||
|
||||
$items = \OCP\Share::getItemShared('file', $share['item_source']);
|
||||
|
|
Loading…
Reference in a new issue