From c894359f203b68f959eb6eec5aaf4f947ed97af7 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 25 Jan 2006 21:27:12 +0000 Subject: Fixed Ticket #24. --- framework/core.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'framework/core.php') diff --git a/framework/core.php b/framework/core.php index 64668625..293209d0 100644 --- a/framework/core.php +++ b/framework/core.php @@ -681,16 +681,21 @@ class PradoBase static $languages=null; if($languages===null) { - $languages=array(); - foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) + if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + $languages[0]='en'; + else { - $array=split(';q=',trim($language)); - $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0; + $languages=array(); + foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) + { + $array=split(';q=',trim($language)); + $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0; + } + arsort($languages); + $languages=array_keys($languages); + if(empty($languages)) + $languages[0]='en'; } - arsort($languages); - $languages=array_keys($languages); - if(empty($languages)) - $languages[0]='en'; } return $languages; } -- cgit v1.2.3