mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-66762 user: stricter email validation.
This commit is contained in:
parent
d6c704bf8e
commit
eb9f830604
@ -525,6 +525,18 @@ EXPECTED;
|
||||
'email' => "moodle@example.com>\r\nRCPT TO:<victim@example.com",
|
||||
'result' => false
|
||||
],
|
||||
[
|
||||
'email' => 'greater>than@example.com',
|
||||
'result' => false
|
||||
],
|
||||
[
|
||||
'email' => 'less<than@example.com',
|
||||
'result' => false
|
||||
],
|
||||
[
|
||||
'email' => '"this<is>validbutwerejectit"@example.com',
|
||||
'result' => false
|
||||
],
|
||||
|
||||
// Extra email addresses from Wikipedia page on Email Addresses.
|
||||
// Valid.
|
||||
|
@ -1110,7 +1110,7 @@ function validate_email($address) {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/phpmailer/moodle_phpmailer.php');
|
||||
|
||||
return moodle_phpmailer::validateAddress($address);
|
||||
return moodle_phpmailer::validateAddress($address) && !preg_match('/[<>]/', $address);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user