From: Michael J. Rubinsky Date: Tue, 11 May 2010 15:39:56 +0000 (-0400) Subject: country fields can be ghosted X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4d4bf6bc54364f8666d009f8378e71b588ffb1fc;p=horde.git country fields can be ghosted --- diff --git a/turba/lib/Driver.php b/turba/lib/Driver.php index 8547bf70a..93dee05b6 100644 --- a/turba/lib/Driver.php +++ b/turba/lib/Driver.php @@ -2517,17 +2517,25 @@ class Turba_Driver /* Countries */ include 'Horde/Nls/Countries.php'; - $country = array_search($message->homecountry, $countries); - if ($country === false) { - $country = Horde_String::convertCharset($message->homecountry, 'utf-8', $charset); - } - $hash['homeCountry'] = $country; - $country = array_search($message->businesscountry, $countries); - if ($country === false) { - $country = Horde_String::convertCharset($message->businesscountry, 'utf-8', $charset); + if (!empty($message->homecountry)) { + $country = array_search($message->homecountry, $countries); + if ($country === false) { + $country = Horde_String::convertCharset($message->homecountry, 'utf-8', $charset); + } + $hash['homeCountry'] = $country; + } elseif (!$message->isGhosted('businesscountry')) { + $hash['homeCountry'] = null; } - $hash['workCountry'] = $country; + if (!empty($message->businesscountry)) { + $country = array_search($message->businesscountry, $countries); + if ($country === false) { + $country = Horde_String::convertCharset($message->businesscountry, 'utf-8', $charset); + } + $hash['workCountry'] = $country; + } elseif (!$message->isGhosted('businesscountry')) { + $hash['workCountry'] = null; + } return $hash; }