Files
deskhub/DeskHub-Webseite/staff/catalog_preview.php
T
2026-10-16 19:12:21 +00:00

14 lines
566 B
PHP

<?php
/** Vorschaubild eines Katalogeintrags (nur Admins): /staff/catalog_preview.php?kind=plugin|theme&slug=... */
require_once __DIR__ . '/../includes/bootstrap.php';
require_admin();
session_write_close();
$img = catalog_preview_image((string) ($_GET['kind'] ?? ''), (string) ($_GET['slug'] ?? ''));
if (!$img) { http_response_code(404); exit; }
header('Content-Type: ' . $img['mime']);
header('Content-Length: ' . strlen($img['data']));
header('X-Content-Type-Options: nosniff');
header('Cache-Control: private, max-age=86400');
echo $img['data'];