From: cajus Date: Sat, 8 Mar 2008 10:09:34 +0000 (+0000) Subject: Added change to avoid accept-to-gettext errors X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9035a2f075a1d766bac0b025c0a6469b3d15d05d;p=gosa.git Added change to avoid accept-to-gettext errors git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9452 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/setup.php b/gosa-core/html/setup.php index 19972d263..e4be820b1 100644 --- a/gosa-core/html/setup.php +++ b/gosa-core/html/setup.php @@ -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 ''; - - 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 ''; + + 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)){ diff --git a/gosa-core/include/accept-to-gettext.inc b/gosa-core/include/accept-to-gettext.inc index 8c19933c4..5913a5098 100644 --- a/gosa-core/include/accept-to-gettext.inc +++ b/gosa-core/include/accept-to-gettext.inc @@ -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; }