diff options
author | kneezle <kneezle@tilde.team> | 2021-01-19 21:29:32 +0000 |
---|---|---|
committer | kneezle <kneezle@tilde.team> | 2021-01-19 21:29:32 +0000 |
commit | 6a3b59a0248febbbb782d73bd1a0eea7cf3d234a (patch) | |
tree | 1eebb8bc1b327676c7ef0740ff68c1b10690aac0 | |
parent | 677386bdcfbbdeb5ed27ce52f7b5c6dd0e1f5235 (diff) | |
download | site-6a3b59a0248febbbb782d73bd1a0eea7cf3d234a.tar.gz |
moved validation to a single check to not pile up error messages
-rwxr-xr-x | html/submit.php | 7 |
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 |