From: Michael J. Rubinsky Date: Fri, 17 Sep 2010 18:01:47 +0000 (-0400) Subject: Don't attempt to get the country name from NLS if we don't have a country entry. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e27db3f3d9eb444997765d9d3612a74478668534;p=horde.git Don't attempt to get the country name from NLS if we don't have a country entry. Horde_Nls::getCountryISO() returns the full array of country codes -> names if an empty value is passed to it. Also, fix hash key for homeCountry when deleting it from PIM -> Server --- diff --git a/turba/lib/Driver.php b/turba/lib/Driver.php index e24ae2d65..24968ac8b 100644 --- a/turba/lib/Driver.php +++ b/turba/lib/Driver.php @@ -2333,7 +2333,7 @@ class Turba_Driver implements Countable break; case 'homeCountry': - $message->homecountry = Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['homeCountry']), $charset, 'utf-8'); + $message->homecountry = !empty($hash['homeCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['homeCountry']), $charset, 'utf-8') : null; break; case 'workStreet': @@ -2353,7 +2353,7 @@ class Turba_Driver implements Countable break; case 'workCountry': - $message->businesscountry = Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['workCountry']), $charset, 'utf-8'); + $message->businesscountry = !empty($hash['workCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['workCountry']), $charset, 'utf-8') : null; case 'homePhone': /* Phone */ @@ -2527,7 +2527,7 @@ class Turba_Driver implements Countable $country = Horde_String::convertCharset($message->homecountry, 'utf-8', $charset); } $hash['homeCountry'] = $country; - } elseif (!$message->isGhosted('businesscountry')) { + } elseif (!$message->isGhosted('homecountry')) { $hash['homeCountry'] = null; }