check if $name is already a country-code, before attempting to find a matching one, which can fail in certain areas of setup

This commit is contained in:
Ralf Becker 2012-01-05 22:00:50 +00:00
parent 8df1d79e59
commit 86d1ee0e35

View File

@ -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;