diff --git a/CHANGELOG b/CHANGELOG index 746734daf..54bde1580 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php index 787c9ae56..c26527cba 100644 --- a/program/lib/Roundcube/rcube_contacts.php +++ b/program/lib/Roundcube/rcube_contacts.php @@ -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; }