aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/language.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/language.php b/include/language.php
index 23aff0a02..e7363cffb 100644
--- a/include/language.php
+++ b/include/language.php
@@ -24,15 +24,15 @@ use CommerceGuys\Intl\Language\LanguageRepository;
* @return array with ordered list of preferred languages from browser
*/
function get_browser_language() {
- $langs = array();
- $lang_parse = array();
+ $langs = [];
+ $lang_parse = [];
if (x($_SERVER, 'HTTP_ACCEPT_LANGUAGE')) {
// break up string into pieces (languages and q factors)
preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
$_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
- if (count($lang_parse[1])) {
+ if (is_array($lang_parse[1])) {
// create a list like "en" => 0.8
$langs = array_combine($lang_parse[1], $lang_parse[4]);