If view does not exist, redirect to console instead of just dying
parent
7bc126abe1
commit
6a68e5577a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue