Skip to content

Commit d316e5a

Browse files
authored
Merge pull request #30690 from nextcloud/backport/30645/stable22
[stable22] New Files internal link GET param to avoid opening the file
2 parents fcb82f6 + b165aa7 commit d316e5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/files/lib/Controller/ViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ protected function getStorageInfo() {
162162
* @return TemplateResponse|RedirectResponse
163163
* @throws NotFoundException
164164
*/
165-
public function showFile(string $fileid = null): Response {
165+
public function showFile(string $fileid = null, int $openfile = 1): Response {
166166
// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
167167
try {
168-
return $this->redirectToFile($fileid, true);
168+
return $this->redirectToFile($fileid, $openfile !== 0);
169169
} catch (NotFoundException $e) {
170170
return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', ['fileNotFound' => true]));
171171
}

0 commit comments

Comments
 (0)