check if valid email before executing

This commit is contained in:
Roman Schenk 2025-11-26 20:58:47 +01:00
parent 881e877760
commit ac56383edf
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,20 @@ include 'zefixAPI.php';
$taskDir = 'tasks';
/**
* E-Mail aus dem Formular holen und serverseitig validieren
*/
$email = isset($_POST['email']) ? trim($_POST['email']) : '';
if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "Bitte geben Sie eine gültige E-Mail-Adresse an.";
echo '<br><a href="index.php">Zurück zur Startseite</a>';
// WICHTIG: Script hier abbrechen, damit KEIN Task angelegt wird
exit;
}
/*
* Request Types:
* Count