Fix for bug #3906 "default country".

In htdocs/lib/common.inc.php, getUserCountry():
- added "global" declaration of "$usr", which was missing
- using "GB" as the fallback country code instead of "EN", which is not a valid country code

In htdocs/newcache.php:
- using "getUserCountry()" to initialize "$sel_country" if no "_POST['country']" was given, instead of "$default_country"
- using "$sel_country" to preselect the country in the countries combobox, instead of "getUserCountrs()"
This commit is contained in:
flopp
2012-07-31 19:44:32 +02:00
parent 691b3d5b10
commit b4d48877d6
2 changed files with 8 additions and 7 deletions
+5 -4
View File
@@ -1198,7 +1198,7 @@ function __autoload($class_name)
function getUserCountry()
{
global $opt, $cookie;
global $opt, $cookie, $usr;
// language specified in cookie?
if ($cookie->is_set('usercountry'))
@@ -1223,7 +1223,8 @@ function __autoload($class_name)
// default country of installation (or domain)
if (isset($opt['template']['default']['country']))
return $opt['template']['default']['country'];
return 'EN';
// country could not be determined by the above checks -> return "GB"
return 'GB';
}
?>
?>