If view does not exist, redirect to console instead of just dying

pull/3783/head
Isaac Connor 2023-11-09 09:57:27 -05:00
parent 7bc126abe1
commit 6a68e5577a
1 changed files with 5 additions and 2 deletions

View File

@ -268,8 +268,11 @@ if ( $includeFiles = getSkinIncludes('views/'.$view.'.php', true, true) ) {
ob_start();
CSPHeaders($view, $cspNonce);
foreach ( $includeFiles as $includeFile ) {
if (!file_exists($includeFile))
ZM\Fatal("View '$view' does not exist");
if (!file_exists($includeFile)) {
ZM\Fatal("View '$view' does not exist, redirecting to console");
header('Location: ?view=console');
return;
}
require_once $includeFile;
}
// If the view overrides $view to 'error', and the user is not logged in, then the