aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2008-09-14 19:40:18 +0000
committernikrou <nikrou@piwigo.org>2008-09-14 19:40:18 +0000
commiteef8aa8838ae6fede0dce3b4df65d140e745e830 (patch)
treeb1c14cdafefc482ff61b1acebee183e9094acf00 /include/functions_user.inc.php
parent9474d5cc67076f8328adfbc68a32444b79bb0b87 (diff)
$_SERVER["HTTP_ACCEPT_LANGUAGE"] could be empty so test it.
git-svn-id: http://piwigo.org/svn/trunk@2537 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_user.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 6276d37a0..b25105c6e 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -851,7 +851,14 @@ function get_default_language()
*/
function get_browser_language(&$lang)
{
- $browser_language = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2);
+ if (!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
+ {
+ $browser_language = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2);
+ }
+ else
+ {
+ $browser_language = '';
+ }
foreach (get_languages() as $language_code => $language_name)
{
if (substr($language_code, 0, 2) == $browser_language)