Show nice error page for not available versions

* fixes #1464

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2016-12-05 22:15:59 +01:00
parent efa9ac1230
commit f03cd2c685
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 9 additions and 1 deletions

View File

@ -31,7 +31,15 @@ OCP\JSON::checkLoggedIn();
$file = $_GET['file'];
$revision=(int)$_GET['revision'];
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;