Update router.php

This commit is contained in:
slawkens 2025-04-20 21:29:22 +02:00
parent c2bf94fb23
commit b71555d60d

View File

@ -89,8 +89,6 @@ if($logged && $account_logged && $account_logged->isLoaded()) {
* Routes loading
*/
$dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r) {
$routes = require SYSTEM . 'routes.php';
$routesFinal = [];
foreach(getDatabasePages() as $page) {
$routesFinal[] = ['*', $page, '__database__/' . $page, 100];
@ -106,6 +104,7 @@ $dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r)
*/
}
$routes = require SYSTEM . 'routes.php';
foreach ($routes as $route) {
if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')) {
if (!is_file(BASE . 'system/pages/' . $route[2])) {