From 5f5f22f5be8964c8c9b9b7d0dfe13210ef740a96 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 15 Feb 2014 13:25:12 +0000 Subject: Fix some PHP notices found indirectly while testing gnutls update. --- localeDetection.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'localeDetection.class.php') 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(); -- cgit v1.2.1