* Addressbook - fix AJAX duplicate check skipped email addresses

This commit is contained in:
nathangray 2018-02-12 09:05:37 -07:00
parent e437a92c7e
commit a213a286df

View File

@ -2600,12 +2600,10 @@ window.egw_LAB.wait(function() {
$matches = null;
$fields = explode(',',$GLOBALS['egw_info']['user']['preferences']['addressbook']['duplicate_fields']);
if (preg_match('/^exec\[([^\]]+)\]$/', $name, $matches)) $name = $matches[1]; // remove exec[ ]
$ret = array('doublicates' => array(), 'msg' => null);
// if email changed, check for doublicates
if (in_array($name, array('email', 'email_home')) && in_array($name, $fields))
if (in_array($name, array('email', 'email_home')) && in_array('contact_'.$name, $fields))
{
if (preg_match(Etemplate\Widget\Url::EMAIL_PREG, $values[$name])) // only search for real email addresses, to not return to many contacts
{