mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 16:16:48 +01:00
Allow contacts without an email address (#5079)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
CHANGELOG Roundcube Webmail
|
||||
===========================
|
||||
|
||||
- Allow contacts without an email address (#5079)
|
||||
- Localized timezone selector (#4983)
|
||||
- Update to TinyMCE 4.5.7
|
||||
- Fix bug where invalid recipients could be silently discarded (#5739)
|
||||
|
||||
@@ -595,9 +595,12 @@ class rcube_contacts extends rcube_addressbook
|
||||
// validate e-mail addresses
|
||||
$valid = parent::validate($save_data, $autofix);
|
||||
|
||||
// require at least one email address or a name
|
||||
if ($valid && !strlen($save_data['firstname'].$save_data['surname'].$save_data['name']) && !array_filter($this->get_col_values('email', $save_data, true))) {
|
||||
$this->set_error(self::ERROR_VALIDATE, 'noemailwarning');
|
||||
// require at least some name or email
|
||||
if ($valid
|
||||
&& !strlen($save_data['firstname'].$save_data['surname'].$save_data['name'])
|
||||
&& !count(array_filter($this->get_col_values('email', $save_data, true)))
|
||||
) {
|
||||
$this->set_error(self::ERROR_VALIDATE, 'nonamewarning');
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user