summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-12-05 22:15:59 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-12-05 22:15:59 +0100
commitf03cd2c685c2390d0cf1d6426bf45e6f50e74ce2 (patch)
treee7675334a30a6cd39d067192f584746cb4c389f4 /apps/files_versions
parentefa9ac1230b59eae4f3f508d8e986ee1af2460da (diff)
downloadnextcloud-server-f03cd2c685c2390d0cf1d6426bf45e6f50e74ce2.tar.gz
nextcloud-server-f03cd2c685c2390d0cf1d6426bf45e6f50e74ce2.zip
Show nice error page for not available versions
* fixes #1464 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
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;