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"; ?>

substr($_path, 0, strrpos($_path, "/"))]); ?>
Cartella superiore
rtrim($requestedPath, "/") . "/" . $file->getBasename()]); ?>
fa-lg">
getBasename() ?>
buffer($file); $downloadName = basename($browsingPath); header('Content-Description: File Transfer'); header("Content-Type: {$mime}"); header("Content-Disposition: attachment; filename={$downloadName}"); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); die($file); }