diff --git a/src/arenas/tictactoe/act.php b/src/arenas/tictactoe/act.php index 39c6711..a520ad7 100644 --- a/src/arenas/tictactoe/act.php +++ b/src/arenas/tictactoe/act.php @@ -72,9 +72,8 @@ switch ($_POST['act']){ 'player-index' =>$playerIndex ); - $httpResponse=json_decode(get_IA_Response($playerURL,$paramsToSend),TRUE); - $playerResponse=$httpResponse['play']; - echo "

******".$playerResponse."**********

"; + $playerResponse=get_IA_Response($playerURL,$paramsToSend)['play']; + //tester la validité de la réponse if((isset($map[$playerResponse])) && ($map[$playerResponse]=="")){ //reponse conforme diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index 15ee9b2..6d78ea3 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -51,5 +51,5 @@ function get_IA_Response($iaUrl,$postParams){ curl_close($ch); echo '

'.$data_string.'

'; echo '

'.$output.'

'; - return htmlentities($output); + return json_decode($output,TRUE); } \ No newline at end of file