Code

Fixed setup white screen when js is disabled
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 8 Mar 2008 10:13:08 +0000 (10:13 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 8 Mar 2008 10:13:08 +0000 (10:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9453 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 60917222aa9a8e556e8cf601ee8a9763e95c195c..61a18045f83b75de8eeea190b49872f440dceed9 100644 (file)
@@ -54,17 +54,6 @@ ini_set("session.gc_maxlifetime",24*60*60);
 session_start ();
 $_SESSION['DEBUGLEVEL']= 1;
 
-/* Check for js */
-if (!isset($_GET['js']) && !isset($_SESSION['js'])){
-  echo '<script language="JavaScript" type="text/javascript">';
-  echo '  location = "setup.php?js=true";';
-  echo '</script>';
-
-  $_SESSION['js']= FALSE;
-} elseif(isset($_GET['js'])) {
-  $_SESSION['js']= TRUE;
-}
-
 /* Attribute initialization, reset errors */
 $_SESSION['errors']             = "";
 $_SESSION['errorsAlreadyPosted']= array();
@@ -91,6 +80,17 @@ if(isset($_POST['lang_selected'])){
   }
 }
 
+/* Check for js */
+if (!isset($_GET['js']) && !isset($_SESSION['js'])){
+  echo '<script language="JavaScript" type="text/javascript">';
+  echo '  location = "setup.php?js=true";';
+  echo '</script>';
+
+  $_SESSION['js']= FALSE;
+} elseif(isset($_GET['js'])) {
+  $_SESSION['js']= TRUE;
+}
+
 $lang = $_SESSION['lang'];
 /* Append .UTF-8 to language string if necessary */
 if(!preg_match("/utf(-)8$/i",$lang)){
index adb5c1d3018939ffed7347513c0bd3003273393f..ff8e2425e3ac7cae29d47c7ed925f31d6de61906 100644 (file)
@@ -200,10 +200,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;
 }