Config::get("jaquettesPath"), "consoles-photos" => Config::get("consolesPhotosPath") ]; if ($fichier === "" || str_contains($fichier, "..") || !isset($dossiers[$type])) { http_response_code(404); exit; } $chemin = $dossiers[$type] . "/" . $fichier; if (!is_file($chemin)) { http_response_code(404); exit; } $extension = strtolower(pathinfo($chemin, PATHINFO_EXTENSION)); $types = [ "jpg" => "image/jpeg", "jpeg" => "image/jpeg", "png" => "image/png", "webp" => "image/webp", "gif" => "image/gif" ]; header("Content-Type: " . ($types[$extension] ?? "application/octet-stream")); header("Cache-Control: public, max-age=604800"); readfile($chemin);