From 699e12523f551287c354e77753e41746a06d190b Mon Sep 17 00:00:00 2001 From: james Date: Thu, 3 Mar 2011 18:11:36 +0000 Subject: [PATCH] make foodreq field based on configuration api registration/fields accepts both string (to json decode) or a post array, so the testapi page works --- api.php | 6 +++++- user.inc.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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