download nur mit gültiger uui

This commit is contained in:
Troy grunt
2026-02-13 23:05:18 +01:00
parent a730b30d4d
commit 74509fbc77
2 changed files with 7 additions and 2 deletions

View File

@@ -6,13 +6,19 @@ require '_func.php';
* Eingaben prüfen
*/
$fileId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$uuid = $_GET['uuid'] ?? null;
$uuid = trim($_GET['uuid'] ?? '');
if ($fileId <= 0 || !$uuid) {
http_response_code(400);
exit('Ungültige Anfrage');
}
if (!preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i', $uuid)) {
http_response_code(400);
exit('Ungültige Anfrage');
//TODO fehlgeschlagener zugriff als fehlerhafte anmeldung ansehen und bei wiederholung ip sperren
}
/**
* Token validieren
*/