From a04450f951426dee5c7fe58f2ce96d0c276f29fb Mon Sep 17 00:00:00 2001 From: Gnieark Date: Fri, 4 Dec 2015 16:24:34 +0100 Subject: [PATCH] fix test existance arene --- src/act.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/act.php b/src/act.php index d7f4539..bc6073c 100644 --- a/src/act.php +++ b/src/act.php @@ -7,10 +7,14 @@ switch($_POST['act']){ $alerts=""; //botGame -> doit exister - if(!in_array($_POST['botGame'],$arenas)){ - //pour le Debug - print_r($_POST); - print_r($arenas); + $arenaExists=false; + foreach($arenas as $arena){ + if($_POST['botGame'] == $arena['id']){ + $arenaExists=true; + break; + } + } + if(!$arenaExists){ error(404,"wrong post parameter"); }