aboutsummaryrefslogtreecommitdiffstats
path: root/localeDetection.class.php
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-02-15 13:25:12 +0000
committerColin Guthrie <colin@mageia.org>2014-02-15 13:25:12 +0000
commit5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96 (patch)
treef653c1c192745d9d4d525f770f69632c4fe5f2c1 /localeDetection.class.php
parent67fa5dba7270df661c2b9b48c52529cb2704e3f8 (diff)
downloadwww-5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96.tar
www-5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96.tar.gz
www-5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96.tar.bz2
www-5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96.tar.xz
www-5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96.zip
Fix some PHP notices found indirectly while testing gnutls update.
Diffstat (limited to 'localeDetection.class.php')
-rw-r--r--localeDetection.class.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/localeDetection.class.php b/localeDetection.class.php
index d1b20357d..d2a3a089d 100644
--- a/localeDetection.class.php
+++ b/localeDetection.class.php
@@ -27,9 +27,12 @@ class ChooseLocale
public function __construct($list=array('en-US'), $force_http_accept_language = null)
{
- $this -> HTTPAcceptLang = is_null($force_http_accept_language) ?
- $_SERVER['HTTP_ACCEPT_LANGUAGE'] :
- $force_http_accept_language;
+ if (null !== $force_http_accept_language) {
+ $this -> HTTPAcceptLang = $force_http_accept_language;
+ } else if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ $this -> HTTPAcceptLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ }
+
$this -> supportedLocales = array_unique($list);
$this -> setDefaultLocale('en-US');
$this -> setCompatibleLocale();