Module: website Branch: master Commit: c14654e092dc4a49e45f682b69f461867b54d7b4 URL: http://source.winehq.org/git/website.git/?a=commit;h=c14654e092dc4a49e45f682...
Author: Jeremy Newman jnewman@codeweavers.com Date: Thu May 29 16:57:27 2008 -0500
fix issue of detection overwriting incorrect var
---
include/html.php | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/html.php b/include/html.php index adf793f..f5833ee 100644 --- a/include/html.php +++ b/include/html.php @@ -57,16 +57,17 @@ class html else if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) { // load from web browser environment - $lang = split(',', array_shift(split(";", $_SERVER["HTTP_ACCEPT_LANGUAGE"]))); - if (isset($lang[0])) + $avail = split(',', array_shift(split(";", $_SERVER["HTTP_ACCEPT_LANGUAGE"]))); + if (isset($avail[0])) { // if first language is a variation, use the parent language - if (strlen($lang[0]) > 2) - $lang[0] = substr($lang[0], 0, 2); + if (strlen($avail[0]) > 2) + $avail[0] = substr($avail[0], 0, 2); // check to make sure lang is defined in our config - if (in_array($lang[0], $GLOBALS['config']->languages)) - $lang = $lang[0]; + if (in_array($avail[0], $GLOBALS['config']->languages)) + $lang = $avail[0]; } + unset($avail); } // return language return $lang;