diff options
author | xue <> | 2006-01-25 21:27:12 +0000 |
---|---|---|
committer | xue <> | 2006-01-25 21:27:12 +0000 |
commit | c894359f203b68f959eb6eec5aaf4f947ed97af7 (patch) | |
tree | 4abedd6e825249b312244f31467dafc40440d19b | |
parent | 3afd35b166267c00f368239b00662866c79bb090 (diff) |
Fixed Ticket #24.
-rw-r--r-- | framework/core.php | 21 |
1 files changed, 13 insertions, 8 deletions
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;
}
|