From 01d4e77bb5563cbf98c3074b4d83b393571315c2 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 8 Mar 2008 10:13:08 +0000 Subject: [PATCH] Fixed setup white screen when js is disabled git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@9453 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/setup.php | 22 +++++++++++----------- include/accept-to-gettext.inc | 10 ++++++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/html/setup.php b/html/setup.php index 60917222a..61a18045f 100644 --- a/html/setup.php +++ b/html/setup.php @@ -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 ''; - - $_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 ''; + + $_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)){ diff --git a/include/accept-to-gettext.inc b/include/accept-to-gettext.inc index adb5c1d30..ff8e2425e 100644 --- a/include/accept-to-gettext.inc +++ b/include/accept-to-gettext.inc @@ -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; } -- 2.30.2