getSession()->start(); if (isset($_GET['s']) && preg_match('/^[-_\.a-zA-Z0-9]+$/', $_GET['s'])) { /** @var LoggerInterface $logger */ $logger = ServiceContainer::getService('logger'); $logger->error('LaunchController', [ 'REQUEST_URI' => $_SERVER['REQUEST_URI'], ]); $script = $_GET['s'].'.php'; } else { throw new NotFoundHttpException(); } if (file_exists($script)) { require_once $script; } else { $script = $cfg['Path']['shared_version'].'web/'.$script; if (file_exists($script)) { require_once $script; } else { throw new NotFoundHttpException(); } } if (!empty($main_class)) { /** @var Page $instance */ $instance = new $main_class(); $instance->run(); } }); return $response; } }