Commit 2370af62 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #14998 from rullzer/ocs_api_new_url

OCS API should return fancy OC url
parents 5a9c9b86 bdde2156
......@@ -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']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment