diff --git a/admin/curl.inc.php b/admin/curl.inc.php index e90f12b..2d6b4c8 100644 --- a/admin/curl.inc.php +++ b/admin/curl.inc.php @@ -37,12 +37,20 @@ exit; } - if(count($array[$k]) == 1) { - $array[$k] = $array[$k][0]; - } else { - /* Leave it alone */ + /* Special cases, leave these as arrays of entries */ + if($k == 'award' || $k == 'prize') { + foreach($array[$k] as &$a) { + xml_dearray($a); + } + continue; } + if(count($array[$k]) != 1) { + echo "Unexpected multielement array, stop."; + exit; + }; + $array[$k] = $array[$k][0]; + if(is_array($array[$k])) { xml_dearray($array[$k]); } @@ -116,11 +124,9 @@ /* Undo variable to array */ $ret['awards'] = $ret['awards']['award']; + foreach($ret['awards'] as &$a) + $a['prizes'] = $a['prizes']['prize']; - /* Turn the awards into an array if it was dearrayed (in the case there is only one */ - if(!is_array($ret['awards'])) { - $ret['awards'] = array($ret['awards']); - } $ret['error'] = 0; $ret['message'] = ''; break;