Commit be61dacc authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1813101: use correct email syntax for noreply address"

parents 0bb64add 95398e81
......@@ -278,8 +278,12 @@ if ($CFG->sslproxy === false && isset($_SERVER['REMOTE_ADDR']) && (!isset($_SERV
}
if (!isset($CFG->noreplyaddress) && isset($CFG->wwwroot)) {
$noreplyaddress = 'noreply@' . parse_url($CFG->wwwroot, PHP_URL_HOST);
try {
set_config('noreplyaddress', $noreplyaddress);
if (!sanitize_email($noreplyaddress)) {
$noreplyaddress = 'noreply@example.org';
}
set_config('noreplyaddress', $noreplyaddress);
}
catch (Exception $e) {
// Do nothing again, same reason as above
......
......@@ -1571,7 +1571,7 @@ function site_warnings() {
}
// Check noreply address is valid.
if (!sanitize_email(get_config('noreplyaddress'))) {
if (!sanitize_email(get_config('noreplyaddress')) || get_config('noreplyaddress') == 'noreply@example.org') {
$warnings[] = get_string('noreplyaddressmissingorinvalid', 'error', get_config('wwwroot') . 'admin/site/options.php?fs=emailsettings');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment