Merge pull request #14998 from rullzer/ocs_api_new_url

OCS API should return fancy OC url
This commit is contained in:
Morris Jobke 2015-03-24 17:04:31 +01:00
commit 2370af62ea
2 changed files with 6 additions and 2 deletions

View file

@ -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 {

View file

@ -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']);