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:
@@ -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';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user