Merge pull request #23190 from owncloud/use-proper-url-for-search-results

Use proper URLs for search results
This commit is contained in:
Thomas Müller 2016-03-14 16:11:17 +01:00
commit f6a5fe452d

View file

@ -79,10 +79,12 @@ class File extends \OCP\Search\Result {
$info = pathinfo($path);
$this->id = $data->getId();
$this->name = $info['basename'];
$this->link = \OCP\Util::linkTo(
'files',
'index.php',
array('dir' => $info['dirname'], 'scrollto' => $info['basename'])
$this->link = \OC::$server->getURLGenerator()->linkToRoute(
'files.view.index',
[
'dir' => $info['dirname'],
'scrollto' => $info['basename'],
]
);
$this->permissions = $data->getPermissions();
$this->path = $path;