From e27db3f3d9eb444997765d9d3612a74478668534 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 17 Sep 2010 14:01:47 -0400 Subject: [PATCH] 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 --- turba/lib/Driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.11.0