Code

Added change to avoid accept-to-gettext errors
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 8 Mar 2008 10:09:34 +0000 (10:09 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 8 Mar 2008 10:09:34 +0000 (10:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9452 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/setup.php
gosa-core/include/accept-to-gettext.inc

index 19972d263a1e42285c5611a8dd4aaa3117672f74..e4be820b13353faaa4034969c3d5317e1f5c3a7e 100644 (file)
@@ -53,17 +53,6 @@ session::start();
 session::set('DEBUGLEVEL',1);
 session::set('errorsAlreadyPosted',array());
 
-/* Check for js */
-if (!isset($_GET['js']) && !session::is_set('js')){
-  echo '<script language="JavaScript" type="text/javascript">';
-  echo '  location = "setup.php?js=true";';
-  echo '</script>';
-
-  session::set('js',FALSE);
-} elseif(isset($_GET['js'])) {
-  session::set('js',TRUE);
-}
-
 /* Attribute initialization, reset errors */
 session::set('errors',"");
 session::set('errorsAlreadyPosted',array());
@@ -91,6 +80,18 @@ if(isset($_POST['lang_selected'])){
   }
 }
 
+/* Check for js */
+if (!isset($_GET['js']) && !session::is_set('js')){
+  echo '<script language="JavaScript" type="text/javascript">';
+  echo '  location = "setup.php?js=true";';
+  echo '</script>';
+
+  session::set('js',FALSE);
+} elseif(isset($_GET['js'])) {
+  session::set('js',TRUE);
+}
+
+
 $lang = session::get('lang');
 /* Append .UTF-8 to language string if necessary */
 if(!preg_match("/utf(-)8$/i",$lang)){
index 8c19933c45e9790c41a9466c3b09b01d4fa87e26..5913a5098c3605284ccfb466ad57eb40032634ed 100644 (file)
@@ -198,10 +198,12 @@ function al2gt($gettextlangs, $mime)
   $gtparts=@preg_split("/\./",$curgtlang);
   $tmp=strtolower($gtparts[0]);
   $lang=preg_replace("/\_/", "-", $tmp);
-  header("Content-Language: $lang");
-  if(isset($gtparts[1])){
-    $charset=$gtparts[1];
-    header("Content-Type: $mime; charset=$charset");
+  if (!headers_sent()){
+    header("Content-Language: $lang");
+    if(isset($gtparts[1])){
+      $charset=$gtparts[1];
+      header("Content-Type: $mime; charset=$charset");
+    }
   }
   return $curgtlang;
 }