moved validation to a single check to not pile up error messages
This commit is contained in:
parent
677386bdcf
commit
6a3b59a024
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue