diff --git a/public/API/queries/comments.php b/public/API/queries/comments.php index de1f3c4..d474f78 100644 --- a/public/API/queries/comments.php +++ b/public/API/queries/comments.php @@ -51,6 +51,10 @@ function newComment($conn, $article, $name, $email, $comment, $hCaptchaResponse) return "Failed to verify Captcha"; } + if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { + return "Invalid email address."; + } + $article = $conn->escape_string($article); $name = $conn->escape_string($name); $email = $conn->escape_string($email);