summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-12-06 12:01:30 +0100
committerGitHub <noreply@github.com>2016-12-06 12:01:30 +0100
commit5326985c711c746dce62540756a826d987522222 (patch)
tree8f67b7280b99ef97cd8b73135cfe7c638297016e /apps/files_versions
parentdb6359d1e42ac355fd2715bc78a6d70d177e377a (diff)
parentf03cd2c685c2390d0cf1d6426bf45e6f50e74ce2 (diff)
downloadnextcloud-server-5326985c711c746dce62540756a826d987522222.tar.gz
nextcloud-server-5326985c711c746dce62540756a826d987522222.zip
Merge pull request #2519 from nextcloud/404-versions-download
Show nice error page for not available versions
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/download.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php
index a2ecd2fc12a..e5c70dd2bc5 100644
--- a/apps/files_versions/download.php
+++ b/apps/files_versions/download.php
@@ -31,7 +31,15 @@ OCP\JSON::checkLoggedIn();
$file = $_GET['file'];
$revision=(int)$_GET['revision'];
-list($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($file);
+try {
+ list($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($file);
+} catch(\OCP\Files\NotFoundException $e) {
+ header("HTTP/1.1 404 Not Found");
+ $tmpl = new OCP\Template('', '404', 'guest');
+ $tmpl->assign('file', '');
+ $tmpl->printPage();
+ exit();
+}
$versionName = '/'.$uid.'/files_versions/'.$filename.'.v'.$revision;