From: cajus Date: Sat, 8 Mar 2008 10:13:08 +0000 (+0000) Subject: Fixed setup white screen when js is disabled X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=01d4e77bb5563cbf98c3074b4d83b393571315c2;p=gosa.git 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 --- 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; }