summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;