diff --git a/chat.php b/chat.php index a15c387..5c54597 100644 --- a/chat.php +++ b/chat.php @@ -1257,7 +1257,7 @@ function send_frameset(){ echo "$H[meta_html]"; echo ''.get_setting('chatname').''; print_stylesheet(); - if(isSet($_COOKIE['test'])){ + if(isSet($_COOKIE['language'])){ echo "<body>$I[noframes]$H[backtologin]</body>"; }else{ echo "<body>$I[noframes]$H[backtologin]</body>"; @@ -1444,7 +1444,7 @@ function send_waiting_room(){ send_frameset(); }else{ $refresh=(int) get_setting('defaultrefresh'); - if(isSet($_COOKIE['test'])){ + if(isSet($_COOKIE['language'])){ print_start('waitingroom', $refresh, "$_SERVER[SCRIPT_NAME]?action=wait&nc=".substr(time(),-6)); }else{ print_start('waitingroom', $refresh, "$_SERVER[SCRIPT_NAME]?action=wait&session=$U[session]&lang=$language&nc=".substr(time(),-6)); @@ -1828,7 +1828,6 @@ function send_login(){ if($ga===4){ send_chat_disabled(); } - setcookie('test', '1'); print_start('login'); $englobal=(int) get_setting('englobalpass'); echo '

'.get_setting('chatname').'

'; @@ -3554,13 +3553,16 @@ function load_lang(){ 'id' =>'Bahasa Indonesia', 'ru' =>'Русский' ); - if(isSet($_REQUEST['lang']) && array_key_exists($_REQUEST['lang'], $L)){ + if(isSet($_REQUEST['lang']) && isSet($L[$_REQUEST['lang']])){ $language=$_REQUEST['lang']; - setcookie('language', $language); - }elseif(isSet($_COOKIE['language']) && array_key_exists($_COOKIE['language'], $L)){ + if(!isSet($_COOKIE['language']) || $_COOKIE['language']!==$language){ + setcookie('language', $language); + } + }elseif(isSet($_COOKIE['language']) && isSet($L[$_COOKIE['language']])){ $language=$_COOKIE['language']; }else{ $language=LANG; + setcookie('language', $language); } include('lang_en.php'); //always include English if($language!=='en'){