fix
This commit is contained in:
parent
b30535ebfc
commit
3411394103
|
@ -6,7 +6,7 @@ switch ($_POST['act']){
|
|||
case "fight":
|
||||
$bots=get_Bots_Array();
|
||||
//clean $_POST vars
|
||||
$postParams=get_Post_Params();
|
||||
$postParams=get_Post_Params(count($bots));
|
||||
if(!$postParams){
|
||||
error(400,"wrong parameters send");
|
||||
die;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
function get_Post_Params(){
|
||||
function get_Post_Params($botsCount){
|
||||
$keysBots=array('bot1','bot2');
|
||||
foreach($keysBots as $botKey){
|
||||
if(!isset($_POST[$botKey])){
|
||||
|
@ -8,7 +8,7 @@ function get_Post_Params(){
|
|||
if(!is_numeric(($_POST[$botKey]))){
|
||||
|
||||
}
|
||||
if(($_POST[$botKey] < 0) OR ($_POST[$botKey] > count($bots))){
|
||||
if(($_POST[$botKey] < 0) OR ($_POST[$botKey] > $botsCount)){
|
||||
error(400,"wrong parameters");
|
||||
die;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
require_once(__DIR__."/functions.php");
|
||||
|
||||
$bots=get_Bots_Array();
|
||||
$postParams=get_Post_Params();
|
||||
$postParams=get_Post_Params(count($bots));
|
||||
if(!$postParams){
|
||||
$bot1="";
|
||||
$bot2="";
|
||||
|
|
Loading…
Reference in New Issue
Block a user