fix PHP Warning: explode(): Empty delimiter

This commit is contained in:
Ralf Becker 2021-12-16 20:22:57 +02:00
parent c6f447f49c
commit 6800484429

View File

@ -1476,7 +1476,7 @@ class Ldap
function _inetorgperson2egw(&$contact, $data, $cn='cn') function _inetorgperson2egw(&$contact, $data, $cn='cn')
{ {
$matches = null; $matches = null;
if(empty($data['givenname'][0])) if (empty($data['givenname'][0]) && !empty($data['sn'][0]))
{ {
$parts = explode($data['sn'][0], $data[$cn][0]); $parts = explode($data['sn'][0], $data[$cn][0]);
$contact['n_prefix'] = trim($parts[0]); $contact['n_prefix'] = trim($parts[0]);