From 5dba209aaedafebe698bd0baaaea28321475dc6d Mon Sep 17 00:00:00 2001 From: james Date: Wed, 2 Mar 2011 14:26:18 +0000 Subject: [PATCH] Fix json_decode, we need the second parameter to specify an assoc array instead of an object --- api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index e0681f5..0cbfab6 100644 --- a/api.php +++ b/api.php @@ -1079,7 +1079,7 @@ switch($request[0]) { } if($_POST['mentors']) { - $mentors = json_decode($_POST['mentors']); + $mentors = json_decode($_POST['mentors'],true); $errors = array(); foreach($mentors as $md){ $result = addMentor($_SESSION['registration_id']); @@ -1116,7 +1116,7 @@ switch($request[0]) { break; } $errors = array(); - $mentorList = json_decode($_POST['mentors']); + $mentorList = json_decode($_POST['mentors'],true); foreach($mentorList as $mentor){ if(!is_array($mentor)){ $errors[] = "Invalid mentor data: $mentor";