Fix: display 404 error instead of 500 when page has been removed from filesystem

This commit is contained in:
slawkens 2025-04-20 20:40:10 +02:00
parent 8cf3409077
commit c2bf94fb23

View File

@ -108,6 +108,10 @@ $dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r)
foreach ($routes as $route) {
if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')) {
if (!is_file(BASE . 'system/pages/' . $route[2])) {
continue;
}
$routesFinal[] = [$route[0], $route[1], 'system/pages/' . $route[2], $route[3] ?? 10000];
}
else {