. * * mrouter.php * * The main router. * * @author Daniele Bonini * @copyrights (c) 2016, 2026 5 Mode */ require "../Private/core/init.inc"; // FUNCTION AND VARIABLE DECLARATIONS // PARAMETERS VALIDATION $url = filter_input(INPUT_GET, "url")??""; $url = strip_tags($url); $url = strtolower(trim(substr($url, 0, 300), "/")); $rndPrefix = substr($url, 0, 6); $myResRouter = getResRouter($rndPrefix); if ($myResRouter !== PHP_STR) { $scriptPath = APP_ROUTE_PATH; define("ROUTE_NAME", "router"); define("ROUTE_FILENAME", $myResRouter ); header("Content-Type: image/png"); require(APP_PUBLIC_PATH . "/$myResRouter"); } else { $scriptPath = APP_ERROR_PATH; define("ROUTE_NAME", "err-404"); define("ROUTE_FILENAME", "err-404.php"); if (ROUTE_NAME==="err-404") { header("HTTP/1.1 404 Not Found"); } require $scriptPath . "/" . ROUTE_FILENAME; }