Make view does not exist an error instead of fatal

pull/4202/head
Isaac Connor 2024-05-08 14:28:40 -04:00
parent 7fdb318e49
commit cbd8b1f40f
1 changed files with 5 additions and 2 deletions

View File

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