ruolo != "SAD") { die_forbidden(); } $logFolder = rtrim(dirname($config["db_log"]), "/"); $requestedPath = $_GET["path"] ?? "/"; $browsingPath = null; // Preveniamo directory trasversal $realBase = realpath($logFolder); $browsingPath = $logFolder . "/" . ltrim($requestedPath, "/"); $browsingPath = realpath($browsingPath); if ($browsingPath === false || strpos($browsingPath, $realBase) !== 0) { // Path non valido $requestedPath = ""; $browsingPath = $logFolder; } $requestedPath = substr($browsingPath, strlen($logFolder)); // Indexing if (is_dir($browsingPath)) { $iterator = new \FilesystemIterator($browsingPath); include_once "{$beRoot}/layout/top.php"; ?>
= Modulo::header($radice) ?>