From 1920a84634c95eb392e1138c42f57aaf7c91b770 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 12 Mar 2018 11:52:00 +0100 Subject: [PATCH] Add rules --- modules/invite/invite-program.php | 30 +++++++++++++------------ override/controllers/AuthController.php | 30 +++++++++++++------------ 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/modules/invite/invite-program.php b/modules/invite/invite-program.php index c7d3e7d9..677df232 100644 --- a/modules/invite/invite-program.php +++ b/modules/invite/invite-program.php @@ -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 ! diff --git a/override/controllers/AuthController.php b/override/controllers/AuthController.php index 14090287..6ff86597 100755 --- a/override/controllers/AuthController.php +++ b/override/controllers/AuthController.php @@ -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'];