diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-09-25 21:47:09 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-09-25 21:47:09 +0200 |
commit | 4077f684e137774f48cb1f575bc8a7bfd862c78b (patch) | |
tree | 3bc38fd58c3435910ce293df09d799778e739483 | |
parent | 05c37526a75bfa431fc1158404eaad792e17e12d (diff) | |
download | nextcloud-server-4077f684e137774f48cb1f575bc8a7bfd862c78b.tar.gz nextcloud-server-4077f684e137774f48cb1f575bc8a7bfd862c78b.zip |
Only have direct preview urls for image files
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index ec345c4e984..a7cf1a78971 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -372,13 +372,16 @@ class ShareController extends Controller { $shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024); $shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024); $shareTmpl['disclaimer'] = $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null); + $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; if ($shareTmpl['previewSupported']) { $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview', ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 't' => $shareTmpl['dirToken']]); - $shareTmpl['previewURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.publicpreview.directLink', ['token' => $token]); + // We just have direct previews for image files + if ($share->getNode()->getMimePart() === 'image') { + $shareTmpl['previewURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.publicpreview.directLink', ['token' => $token]); + } } else { $shareTmpl['previewImage'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-fb.png')); - $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; } // Load files we need |