Skip to content

Commit

Permalink
fix: Changes email validation to match @LearningLocker. (Thanks @Andy…
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyHubert authored and ryasmi committed Oct 4, 2018
1 parent f8d5cdc commit 9ef84f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformer/utils/get_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

function get_user(array $config, \stdClass $user) {
$fullname = get_full_name($user);
$hasvalidemail = filter_var($user->email, FILTER_VALIDATE_EMAIL);
// The following email validation matches that in Learning Locker
$hasvalidemail = mb_ereg_match("[A-Z0-9\\.\\`\\'_%+-]+@[A-Z0-9.-]+\\.[A-Z]{1,63}$", $user->email, "i");

if (array_key_exists('send_mbox', $config) && $config['send_mbox'] == true && $hasvalidemail) {
return [
Expand Down

0 comments on commit 9ef84f1

Please sign in to comment.