Added basic spambot countermeasure
This commit is contained in:
parent
939deb5dd5
commit
d7fc87685d
2 changed files with 13 additions and 0 deletions
|
@ -340,6 +340,16 @@ MSG;
|
|||
break;
|
||||
}
|
||||
|
||||
$checkSpamBot = mb_strtolower($_POST['auth']['meow'] ?? '');
|
||||
$spamBotValid = [
|
||||
'19', '21', 'nineteen', 'nine-teen', 'nine teen', 'twentyone', 'twenty-one', 'twenty one',
|
||||
];
|
||||
|
||||
if (!in_array($checkSpamBot, $spamBotValid)) {
|
||||
$authRegistrationError = 'Human only cool club, robots begone.';
|
||||
break;
|
||||
}
|
||||
|
||||
$usernameValidation = user_validate_username($authUsername, true);
|
||||
if ($usernameValidation !== '') {
|
||||
$authRegistrationError = $usernameValidationErrors[$usernameValidation];
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
name="auth[email]" placeholder="E-mail"
|
||||
value="{{ auth_email|default('') }}" required>
|
||||
|
||||
<input class="input__text input__text--new auth__input" type="text"
|
||||
name="auth[meow]" placeholder="What is the outcome of nine plus ten?" required>
|
||||
|
||||
<button class="input__button input__button--new">Sign up</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Reference in a new issue