diff options
author | Evan Prodromou <evan@status.net> | 2010-03-03 18:20:45 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-03 18:20:45 -0500 |
commit | 0f1c6e239acbf2c024c3aae9819d891f02b05bfd (patch) | |
tree | 42e923d0b8dd35ca2592a68a4dd26e686361b4c2 /lib/util.php | |
parent | 13521cb510f2377e9b865b0506f92ada9ef9b3cd (diff) | |
parent | 4103e8584c7ccfb444af0814345104afedd2c6fc (diff) |
Merge branch 'testing'
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php index 46be920fa..da2799d4f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -105,11 +105,13 @@ function common_language() // Otherwise, find the best match for the languages requested by the // user's browser... - $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null; - if (!empty($httplang)) { - $language = client_prefered_language($httplang); - if ($language) - return $language; + if (common_config('site', 'langdetect')) { + $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null; + if (!empty($httplang)) { + $language = client_prefered_language($httplang); + if ($language) + return $language; + } } // Finally, if none of the above worked, use the site's default... |