From f987273f118a12d443b6789c2ab59d7a4b01f678 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 19 Dec 2009 14:03:31 -0500 Subject: Ignore user language settings that aren't listed in language config; we'll then fall back to current autodetection. This prevents the surprises where your profile suddenly switches to Arabic because it was selected by default due to lack of a match in the drop-down box. --- lib/util.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/util.php b/lib/util.php index 99a0a1db3..5d20ed82d 100644 --- a/lib/util.php +++ b/lib/util.php @@ -91,8 +91,16 @@ function common_language() if (_have_config() && common_logged_in()) { $user = common_current_user(); $user_language = $user->language; - if ($user_language) - return $user_language; + + if ($user->language) { + // Validate -- we don't want to end up with a bogus code + // left over from some old junk. + foreach (common_config('site', 'languages') as $code => $info) { + if ($info['lang'] == $user_language) { + return $user_language; + } + } + } } // Otherwise, find the best match for the languages requested by the -- cgit v1.2.3-54-g00ecf From 30c2e2ce83282f0bc268153d7ec465fbb5cf00ca Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 22 Dec 2009 16:41:39 -0800 Subject: update to rc2 --- lib/common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/common.php b/lib/common.php index 9b3ded037..7fa1910af 100644 --- a/lib/common.php +++ b/lib/common.php @@ -20,9 +20,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } //exit with 200 response, if this is checking fancy from the installer -if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } +if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } -define('STATUSNET_VERSION', '0.9.0rc1'); +define('STATUSNET_VERSION', '0.9.0rc2'); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility define('STATUSNET_CODENAME', 'Stand'); -- cgit v1.2.3-54-g00ecf