Code

Fixed errors if default language wasn't sent in header
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 10:11:30 +0000 (10:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 10:11:30 +0000 (10:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7698 594d385d-05f5-0310-b6e9-bd551577e9d8

include/accept-to-gettext.inc

index 7d39ecf934ca6253037335eb8bf4d51835e8c96f..621863cb1a9e9c956643d783a5b352dc36baaf97 100644 (file)
@@ -194,15 +194,14 @@ function al2gt($gettextlangs, $mime)
 
   /* We must re-parse the gettext-string now, since we may have found it
    * through a "*" qualifier.*/
-  
   $gtparts=@preg_split("/\./",$curgtlang);
   $tmp=strtolower($gtparts[0]);
   $lang=preg_replace("/\_/", "-", $tmp);
-  $charset=$gtparts[1];
-
   header("Content-Language: $lang");
-  header("Content-Type: $mime; charset=$charset");
-
+  if(isset($gtparts[1])){
+    $charset=$gtparts[1];
+    header("Content-Type: $mime; charset=$charset");
+  }
   return $curgtlang;
 }