MDL-78543 admin: fix invalid default email setting with localhost site

This commit is contained in:
Petr Skoda 2023-07-13 08:42:21 +02:00
parent 24c416592c
commit c1bb36eadb

View File

@ -516,8 +516,12 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_heading('noreplydomainheading', new lang_string('noreplydomain', 'admin'),
new lang_string('noreplydomaindetail', 'admin')));
$default = clean_param('noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL);
if (!$default) {
$default = null;
}
$temp->add(new admin_setting_configtext('noreplyaddress', new lang_string('noreplyaddress', 'admin'),
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL));
new lang_string('confignoreplyaddress', 'admin'), $default, PARAM_EMAIL));
$temp->add(new admin_setting_configtextarea('allowedemaildomains',
new lang_string('allowedemaildomains', 'admin'),