Skip to content
Snippets Groups Projects
Commit 1f4a7341 authored by Gina Haeussge's avatar Gina Haeussge
Browse files

Allow multiple mail addresses in $conf['notify']

Ignore-this: cb12d98437bc7bd4e3fb641a39b277c5

According to the documentation, $conf['notify'] may be a comma-separated list
of email addresses. However, the config admin did not allow this yet.

darcs-hash:20091108115237-2b4f5-67e43dc767bd3aa18222cbb8272efaaf0ba0f4d3.gz
parent 8c2ca0fa
No related branches found
No related tags found
No related merge requests found
......@@ -534,6 +534,7 @@ if (!class_exists('setting_email')) {
class setting_email extends setting_string {
var $_pattern = SETTING_EMAIL_PATTERN; // no longer required, retained for backward compatibility - FIXME, may not be necessary
var $_multiple = false;
/**
* update setting with user provided value $input
......@@ -548,10 +549,18 @@ if (!class_exists('setting_email')) {
$value = is_null($this->_local) ? $this->_default : $this->_local;
if ($value == $input) return false;
if (!mail_isvalid($input)) {
$this->_error = true;
$this->_input = $input;
return false;
if ($this->_multiple) {
$mails = array_filter(array_map('trim', split(',', $input)));
} else {
$mails = array($input);
}
foreach ($mails as $mail) {
if (!mail_isvalid($mail)) {
$this->_error = true;
$this->_input = $input;
return false;
}
}
$this->_local = $input;
......
......@@ -146,7 +146,7 @@ $meta['_editing'] = array('fieldset');
$meta['usedraft'] = array('onoff');
$meta['htmlok'] = array('onoff');
$meta['phpok'] = array('onoff');
$meta['notify'] = array('email');
$meta['notify'] = array('email', '_multiple' => true);
$meta['subscribers'] = array('onoff');
$meta['locktime'] = array('numeric');
$meta['cachetime'] = array('numeric');
......
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