@@ -53,24 +53,24 @@ discard block |
||
| 53 | 53 | $this->languages = array(); |
| 54 | 54 | |
| 55 | 55 | if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
| 56 | - return $this->languages; |
|
| 56 | + return $this->languages; |
|
| 57 | 57 | |
| 58 | 58 | $info = new CultureInfo(); |
| 59 | 59 | |
| 60 | 60 | foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) |
| 61 | 61 | { |
| 62 | - // Cut off any q-value that might come after a semi-colon |
|
| 63 | - if ($pos = strpos($lang, ';')) |
|
| 64 | - $lang = trim(substr($lang, 0, $pos)); |
|
| 62 | + // Cut off any q-value that might come after a semi-colon |
|
| 63 | + if ($pos = strpos($lang, ';')) |
|
| 64 | + $lang = trim(substr($lang, 0, $pos)); |
|
| 65 | 65 | |
| 66 | 66 | if (strstr($lang, '-')) |
| 67 | 67 | { |
| 68 | 68 | $codes = explode('-',$lang); |
| 69 | 69 | if($codes[0] == 'i') |
| 70 | 70 | { |
| 71 | - // Language not listed in ISO 639 that are not variants |
|
| 72 | - // of any listed language, which can be registerd with the |
|
| 73 | - // i-prefix, such as i-cherokee |
|
| 71 | + // Language not listed in ISO 639 that are not variants |
|
| 72 | + // of any listed language, which can be registerd with the |
|
| 73 | + // i-prefix, such as i-cherokee |
|
| 74 | 74 | if(count($codes)>1) |
| 75 | 75 | $lang = $codes[1]; |
| 76 | 76 | } |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | $lang .= '_'.strtoupper($codes[$i]); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | - } |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | if($info->validCulture($lang)) |
| 92 | 92 | $this->languages[] = $lang; |
| 93 | - } |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | 95 | return $this->languages; |
| 96 | 96 | } |
@@ -101,20 +101,20 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | function getCharsets() |
| 103 | 103 | { |
| 104 | - if($this->charsets !== null) { |
|
| 104 | + if($this->charsets !== null) { |
|
| 105 | 105 | return $this->charsets; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $this->charsets = array(); |
| 109 | 109 | |
| 110 | 110 | if (!isset($_SERVER['HTTP_ACCEPT_CHARSET'])) |
| 111 | - return $this->charsets; |
|
| 111 | + return $this->charsets; |
|
| 112 | 112 | |
| 113 | 113 | foreach (explode(',', $_SERVER['HTTP_ACCEPT_CHARSET']) as $charset) |
| 114 | 114 | { |
| 115 | - if (!empty($charset)) |
|
| 116 | - $this->charsets[] = preg_replace('/;.*/', '', $charset); |
|
| 117 | - } |
|
| 115 | + if (!empty($charset)) |
|
| 116 | + $this->charsets[] = preg_replace('/;.*/', '', $charset); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | 119 | return $this->charsets; |
| 120 | 120 | } |