Amélioration ; ajout de photo de console et ajout de checkbox physique, demat ou ROM

This commit is contained in:
LAINEY Grégory committed 2026-09-29 11:55:02 +02:00
1 parent df11d023f0
commit 3235bc50c7
22 files changed
+710 -62

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . "/src/Config.php";
Config::charger();
$type = $_GET["type"] ?? "jaquettes";
$fichier = basename($_GET["fichier"] ?? "");
$dossiers = [
"jaquettes" => 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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.