Use proper URLs for search results

Fixes https://github.com/owncloud/core/issues/23136
This commit is contained in:
Lukas Reschke 2016-03-12 22:29:47 +01:00
parent a09ffb274b
commit effc522572
1 changed files with 6 additions and 4 deletions

View File

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