Skip to content
Snippets Groups Projects
Commit 9ef84f18 authored by Andy Hubert's avatar Andy Hubert Committed by Ryan Smith
Browse files

fix: Changes email validation to match @LearningLocker. (Thanks @AndyHubert - #281)

parent f8d5cdcd
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,8 @@ defined('MOODLE_INTERNAL') || die();
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 [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment