summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_contacts.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-10-19 15:51:12 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-10-19 15:51:12 +0200
commita69363961309e46adba5cf5653a38b92af6bccaa (patch)
treee9ab0e6fc7f5eef32a1ae94d0640174598bdada3 /program/lib/Roundcube/rcube_contacts.php
parent49b8e5d0bb712ccf1a1a52bd794d3d7bb905a493 (diff)
Require name or email for sql address book only
Diffstat (limited to 'program/lib/Roundcube/rcube_contacts.php')
-rw-r--r--program/lib/Roundcube/rcube_contacts.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index 6d01368a1..5c9e5ab39 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -592,8 +592,8 @@ class rcube_contacts extends rcube_addressbook
// validate e-mail addresses
$valid = parent::validate($save_data, $autofix);
- // require at least one e-mail address (syntax check is already done)
- if ($valid && !array_filter($this->get_col_values('email', $save_data, true))) {
+ // 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');
$valid = false;
}