diff --git a/api/src/Contacts/Ldap.php b/api/src/Contacts/Ldap.php index 484ce0464c..8100947d03 100644 --- a/api/src/Contacts/Ldap.php +++ b/api/src/Contacts/Ldap.php @@ -821,9 +821,10 @@ class Ldap } foreach($this->schema2egw as $mapping) { - if (substr($egwSearchKey, 0, 8) === 'contact_') + $matches = null; + if (preg_match('/^(egw_addressbook\.)?(contact_)?(.*)$/', $egwSearchKey, $matches)) { - $egwSearchKey = substr($egwSearchKey, 8); + $egwSearchKey = $matches[3]; } if(($ldapSearchKey = $mapping[$egwSearchKey])) {