diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-19 10:10:19 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-19 10:10:19 +0200 |
commit | cc9b36131cf971f51d638501ef4da73c9fbedf18 (patch) | |
tree | f85000d79d6c8b05b03f68e163517a19f0849323 /apps/files/lib | |
parent | 54f79a28f6650ec5cb4fbd9e152eb1d6fb0aa0cb (diff) | |
download | nextcloud-server-cc9b36131cf971f51d638501ef4da73c9fbedf18.tar.gz nextcloud-server-cc9b36131cf971f51d638501ef4da73c9fbedf18.zip |
When requesting a permalink to an invalid file redirect
We need to do the redirect to update address bar.
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 9d26c048368..db8f32ddf73 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -143,15 +143,14 @@ class ViewController extends Controller { * @param string $dir * @param string $view * @param string $fileid - * @return TemplateResponse + * @return TemplateResponse|RedirectResponse */ - public function index($dir = '', $view = '', $fileid = null) { - $fileNotFound = false; + public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) { if ($fileid !== null) { try { return $this->showFile($fileid); } catch (NotFoundException $e) { - $fileNotFound = true; + return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true])); } } |