about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorkneezle <kneezle@tilde.team>2021-01-19 21:29:32 +0000
committerkneezle <kneezle@tilde.team>2021-01-19 21:29:32 +0000
commit6a3b59a0248febbbb782d73bd1a0eea7cf3d234a (patch)
tree1eebb8bc1b327676c7ef0740ff68c1b10690aac0
parent677386bdcfbbdeb5ed27ce52f7b5c6dd0e1f5235 (diff)
downloadsite-6a3b59a0248febbbb782d73bd1a0eea7cf3d234a.tar.gz
moved validation to a single check to not pile up error messages
-rwxr-xr-xhtml/submit.php7
1 files changed, 1 insertions, 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 .= "<li>invalid email address. did you mean:  " . htmlspecialchars($result["email"]) . "</li>";
     }
 
-    if ($_REQUEST["sshkey"] == "") {
+    if ($_REQUEST["sshkey"] == "" || substr($_REQUEST["sshkey"], 0, 4) !== "ssh-") {
         $message .= "<li>ssh key required: please create one and submit the public key</li>";
     }
 
-    if (mb_substr($_REQUEST["sshkey"], 0, 4) !== "ssh-") {
-                $message .= "<li>PUBLIC ssh key required: please create one and submit the public key</li>";
-                    
-    }
-
 
     if ($message == "") { // no validation errors