Add 404 response code on erroneous IDs in index.php

This commit is contained in:
Joshua Ramon Enslin 2022-06-28 17:41:00 +02:00
parent 648e777209
commit 74c66f3f96
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -38,6 +38,7 @@ foreach (MDEventsSet::EVENT_IDS as $j) {
$availableLangs = MD_STD::scandir(__DIR__ . "/../l10n/translation-musdb");
if (!empty($_GET['id']) and !($id = filter_var($_GET['id'], FILTER_VALIDATE_INT))) {
http_response_code(404);
echo "Error: IDs must be presented in a numeric format.";
return;
}