From 6a3b59a0248febbbb782d73bd1a0eea7cf3d234a Mon Sep 17 00:00:00 2001 From: kneezle Date: Tue, 19 Jan 2021 21:29:32 +0000 Subject: [PATCH] moved validation to a single check to not pile up error messages --- html/submit.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/html/submit.php b/html/submit.php index e51900b..e8fcd15 100755 --- a/html/submit.php +++ b/html/submit.php @@ -101,15 +101,10 @@ if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) { $message .= "
  • invalid email address. did you mean: " . htmlspecialchars($result["email"]) . "
  • "; } - if ($_REQUEST["sshkey"] == "") { + if ($_REQUEST["sshkey"] == "" || substr($_REQUEST["sshkey"], 0, 4) !== "ssh-") { $message .= "
  • ssh key required: please create one and submit the public key
  • "; } - if (mb_substr($_REQUEST["sshkey"], 0, 4) !== "ssh-") { - $message .= "
  • PUBLIC ssh key required: please create one and submit the public key
  • "; - - } - if ($message == "") { // no validation errors