mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
Merge branch 'MDL-76559-master' of https://github.com/andrewnicols/moodle
This commit is contained in:
commit
5bc72f5176
@ -599,6 +599,20 @@ EXPECTED;
|
||||
'result' => false
|
||||
],
|
||||
|
||||
// Empty e-mail addresess are not valid.
|
||||
[
|
||||
'email' => '',
|
||||
'result' => false,
|
||||
],
|
||||
[
|
||||
'email' => null,
|
||||
'result' => false,
|
||||
],
|
||||
[
|
||||
'email' => false,
|
||||
'result' => false,
|
||||
],
|
||||
|
||||
// Extra email addresses from Wikipedia page on Email Addresses.
|
||||
// Valid.
|
||||
[
|
||||
|
@ -1108,7 +1108,12 @@ function page_get_doc_link_path(moodle_page $page) {
|
||||
*/
|
||||
function validate_email($address) {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/phpmailer/moodle_phpmailer.php');
|
||||
|
||||
if ($address === null || $address === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
require_once("{$CFG->libdir}/phpmailer/moodle_phpmailer.php");
|
||||
|
||||
return moodle_phpmailer::validateAddress($address) && !preg_match('/[<>]/', $address);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user