forked from science-ation/science-ation
Fix json_decode, we need the second parameter to specify an assoc array instead of an object
This commit is contained in:
parent
0e45df5df8
commit
5dba209aae
4
api.php
4
api.php
@ -1079,7 +1079,7 @@ switch($request[0]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($_POST['mentors']) {
|
if($_POST['mentors']) {
|
||||||
$mentors = json_decode($_POST['mentors']);
|
$mentors = json_decode($_POST['mentors'],true);
|
||||||
$errors = array();
|
$errors = array();
|
||||||
foreach($mentors as $md){
|
foreach($mentors as $md){
|
||||||
$result = addMentor($_SESSION['registration_id']);
|
$result = addMentor($_SESSION['registration_id']);
|
||||||
@ -1116,7 +1116,7 @@ switch($request[0]) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$mentorList = json_decode($_POST['mentors']);
|
$mentorList = json_decode($_POST['mentors'],true);
|
||||||
foreach($mentorList as $mentor){
|
foreach($mentorList as $mentor){
|
||||||
if(!is_array($mentor)){
|
if(!is_array($mentor)){
|
||||||
$errors[] = "Invalid mentor data: $mentor";
|
$errors[] = "Invalid mentor data: $mentor";
|
||||||
|
Loading…
Reference in New Issue
Block a user