Add rules

This commit is contained in:
Michael RICOIS 2018-03-12 11:52:00 +01:00
parent d1d0642f91
commit 1920a84634
2 changed files with 32 additions and 28 deletions

View File

@ -136,22 +136,24 @@ if($canSendInvitations) {
// Real association
$replaceSLD = array(
'@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.',
'@gail.' => '@gmail.',
'@gml.' => '@gmail.',
'@gmai.' => '@gmail.',
'@gmil.' => '@gmail.',
'@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.',
'@gail.' => '@gmail.',
'@gml.' => '@gmail.',
'@gmai.' => '@gmail.',
'@gmil.' => '@gmail.',
);
$replaceGlobal = array(
'@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr',
'@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr',
'@yahoocom' => '@yahoo.com',
'@yahoofr' => '@yahoo.fr',
);
// Real use case replacement
$friendEmail = strtr($friendEmail, $replaceGlobal);
@ -163,7 +165,7 @@ if($canSendInvitations) {
$sld = substr($friendEmail, $atPos + 1, strlen($friendEmail) - ($atPos+1) - (strlen($tld)+1) );
if (empty($tld)) {
$this->errors[] = Tools::displayError('Invalid email');
$_POST['email'] = '';
$_POST['friendsEmail'] = '';
}
if (empty($this->errors)) {
// If you have a complete list of TLD, check it !

View File

@ -167,22 +167,24 @@ class AuthController extends AuthControllerCore
// Real association
$replaceSLD = array(
'@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.',
'@gail.' => '@gmail.',
'@gml.' => '@gmail.',
'@gmai.' => '@gmail.',
'@gmil.' => '@gmail.',
'@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.',
'@gail.' => '@gmail.',
'@gml.' => '@gmail.',
'@gmai.' => '@gmail.',
'@gmil.' => '@gmail.',
);
$replaceGlobal = array(
'@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr',
'@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr',
'@yahoocom' => '@yahoo.com',
'@yahoofr' => '@yahoo.fr',
);
// Real use case replacement
$email = strtr($email, $replaceGlobal);
@ -220,7 +222,7 @@ class AuthController extends AuthControllerCore
}
}
}
echo $email; exit;
/* Preparing customer */
$customer = new Customer();
$lastnameAddress = $_POST['lastname'];