From 4abd03488000cf9fae638276b4dee182e37b7b27 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Tue, 23 Jan 2018 13:46:10 +0000 Subject: [PATCH 1/2] normalizing emails in lowercase --- lib/Subscribers/ImportExport/Import/Import.php | 2 +- tests/unit/Subscribers/ImportExport/Import/ImportTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Subscribers/ImportExport/Import/Import.php b/lib/Subscribers/ImportExport/Import/Import.php index d17323c510..dda7c75093 100644 --- a/lib/Subscribers/ImportExport/Import/Import.php +++ b/lib/Subscribers/ImportExport/Import/Import.php @@ -159,7 +159,7 @@ class Import { if(!is_email($email)) { $invalid_records[] = $index; } - return $email; + return strtolower($email); }, array_keys($data), $data ); } diff --git a/tests/unit/Subscribers/ImportExport/Import/ImportTest.php b/tests/unit/Subscribers/ImportExport/Import/ImportTest.php index 7317f932f0..54178dd8fb 100644 --- a/tests/unit/Subscribers/ImportExport/Import/ImportTest.php +++ b/tests/unit/Subscribers/ImportExport/Import/ImportTest.php @@ -23,7 +23,7 @@ class ImportTest extends \MailPoetTest { array( 'Adam', 'Smith', - 'adam@smith.com', + 'Adam@smith.com', 'France' ), array( From 37c58c6aa4bdb4c7b87e75a2cb93139ebd2033ca Mon Sep 17 00:00:00 2001 From: stoletniy Date: Tue, 23 Jan 2018 18:08:13 +0300 Subject: [PATCH 2/2] Add a comment about testing normalization [MAILPOET-1271] --- tests/unit/Subscribers/ImportExport/Import/ImportTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Subscribers/ImportExport/Import/ImportTest.php b/tests/unit/Subscribers/ImportExport/Import/ImportTest.php index 54178dd8fb..f1e8bf7ab6 100644 --- a/tests/unit/Subscribers/ImportExport/Import/ImportTest.php +++ b/tests/unit/Subscribers/ImportExport/Import/ImportTest.php @@ -23,7 +23,7 @@ class ImportTest extends \MailPoetTest { array( 'Adam', 'Smith', - 'Adam@smith.com', + 'Adam@smith.com', // capitalized to test normalization 'France' ), array(