diff --git a/api.php b/api.php index 7ee778c..3ae877a 100644 --- a/api.php +++ b/api.php @@ -842,7 +842,11 @@ switch($request[0]) { return(fields array) */ case 'fields': - $reqroles=json_decode($_POST['roles'],true); + if(is_array($_POST['roles'])) { + $reqroles=$_POST['roles']; + } else { + $reqroles=json_decode($_POST['roles'],true); + } if(is_array($reqroles)) { for($x=0;$x