Code

Fixed warnings in get text
[gosa.git] / include / accept-to-gettext.inc
index 52647c6606ece6f98932726eaa88c394c248a2b4..7d39ecf934ca6253037335eb8bf4d51835e8c96f 100644 (file)
@@ -86,6 +86,13 @@ function find_match($curlscore,$curcscore,$curgtlang,$langval,$charval,
 
 function al2gt($gettextlangs, $mime) 
 {
+  /* Check if ACCEPT_LANGUAGE isset */
+  if(!isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){
+    $_SERVER["HTTP_ACCEPT_LANGUAGE"] = "";
+  }
+  if(!isset($_SERVER["HTTP_ACCEPT_CHARSET"])){
+    $_SERVER["HTTP_ACCEPT_CHARSET"] = "";
+  }
 
   /* default to "everything is acceptable", as RFC2616 specifies */
   $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' :
@@ -161,6 +168,9 @@ function al2gt($gettextlangs, $mime)
       $alscores[$noct[0]] = "";
     }
   
+    if(!isset($acscores[$gtcs])){
+      $acscores[$gtcs] = "";
+    }
     $testvals=array(
         array($alscores[$allang], $acscores[$gtcs]),
         array($alscores[$noct[0]], $acscores[$gtcs]),