mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-13 11:37:05 +01:00
Allow contacts without an email address (#5079)
This commit is contained in:
@@ -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