mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
New config: account_mail_block_plus_sign
Block emails with '+' signs like test+box@gmail.com (help protect against spamming accounts)
This commit is contained in:
parent
e84c6f7a24
commit
3368fbd058
@ -94,6 +94,7 @@ $config = array(
|
||||
'account_create_character_create' => true, // allow directly to create character on create account page?
|
||||
'account_mail_verify' => false, // force users to confirm their email addresses when registering account
|
||||
'account_mail_unique' => true, // email addresses cannot be duplicated? (one account = one email)
|
||||
'account_mail_block_plus_sign' => true, // block email with '+' signs like test+box@gmail.com (help protect against spamming accounts)
|
||||
'account_premium_days' => 0, // default premium days on new account
|
||||
'account_premium_points' => 0, // default premium points on new account
|
||||
'account_welcome_mail' => true, // send welcome email when user registers
|
||||
|
@ -117,6 +117,14 @@ class Validator
|
||||
return false;
|
||||
}
|
||||
|
||||
if(config('account_mail_block_plus_sign')) {
|
||||
$explode = explode('@', $email);
|
||||
if(isset($explode[0]) && (strpos($explode[0],'+') !== false)) {
|
||||
self::$lastError = 'Please do not use plus (+) sign in your e-mail.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email)) {
|
||||
self::$lastError = 'Invalid e-mail format.';
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user