rebuild to module
This commit is contained in:
@@ -28,8 +28,21 @@ if (str_contains($uriPath, '..')) {
|
||||
exit('Bad request');
|
||||
}
|
||||
|
||||
// Root → page/index.php
|
||||
if ($uriPath === '' || $uriPath === 'index' || $uriPath === 'index.php') {
|
||||
// Spezialrouten für Module
|
||||
if (str_starts_with($uriPath, 'modules/setup/')) {
|
||||
$_GET['module'] = trim(substr($uriPath, strlen('modules/setup/')), '/');
|
||||
$target = __DIR__ . '/page/modules_setup.php';
|
||||
} elseif (preg_match('~^module/([a-zA-Z0-9_-]+)(?:/(.+))?$~', $uriPath, $m)) {
|
||||
$module = $m[1];
|
||||
$page = isset($m[2]) && $m[2] !== '' ? trim($m[2], '/') : 'index';
|
||||
$modulePage = app()->modules()->resolvePage($module, $page);
|
||||
if ($modulePage) {
|
||||
$target = $modulePage;
|
||||
} else {
|
||||
http_response_code(404);
|
||||
$target = __DIR__ . '/page/404.php';
|
||||
}
|
||||
} elseif ($uriPath === '' || $uriPath === 'index' || $uriPath === 'index.php') {
|
||||
$target = __DIR__ . '/page/index.php';
|
||||
} else {
|
||||
$base = __DIR__ . '/page/' . $uriPath;
|
||||
|
||||
Reference in New Issue
Block a user