From 79a3b59ccb7c17d340f7656fd65b4b02cd0f10ec Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Wed, 4 Nov 2009 15:09:24 +0000 Subject: [PATCH] avoid setting fullname to empty string by first checking the strlen of it --- addressbook/inc/class.addressbook_bo.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index be329b4e33..4bb6cd0b68 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -618,10 +618,11 @@ class addressbook_bo extends addressbook_so $contact['modifier'] = $this->user; $contact['modified'] = $this->now_su; // set full name and fileas from the content - if (!isset($contact['n_fn']) || $contact['n_fn'] != $this->fullname($contact)) { - $contact['n_fn'] = $this->fullname($contact); + if (strlen($fullname = $this->fullname($contact)) > 0 && (!isset($contact['n_fn']) || $contact['n_fn'] != $fullname)) { + $contact['n_fn'] = $fullname; if (isset($contact['org_name'])) $contact['n_fileas'] = $this->fileas($contact); } + unset($fullname); $to_write = $contact; // (non-admin) user editing his own account, make sure he does not change fields he is not allowed to (eg. via SyncML or xmlrpc) if (!$ignore_acl && !$contact['owner'] && !$this->is_admin($contact))