From 19dcc2e65455d0cf7f103793ffd498c0e40e4ac8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Jan 2012 21:58:28 +0000 Subject: [PATCH] check if $name is already a country-code, before attempting to find a matching one, which can fail in certain areas of setup --- phpgwapi/inc/class.country.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpgwapi/inc/class.country.inc.php b/phpgwapi/inc/class.country.inc.php index 86ba8a1109..6672b9ea8b 100755 --- a/phpgwapi/inc/class.country.inc.php +++ b/phpgwapi/inc/class.country.inc.php @@ -387,6 +387,11 @@ class country { if (!$name) return ''; // nothing to do + if (strlen($name) == 2 && isset($this->country_array[$name])) + { + return $name; // $name is already a country-code + } + if (($code = array_search(strtoupper($name),$this->country_array)) !== false) { return $code;