Skip to content

Commit

Permalink
webservice MDL-16805 fix REST server bug: empty list (<MULTIPLE></MUL…
Browse files Browse the repository at this point in the history
…TIPLE>) without php error
  • Loading branch information
mouneyrac committed Feb 9, 2010
1 parent 7c964cd commit 17ecdd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webservice/rest/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ protected static function xmlize_result($returns, $desc) {

} else if ($desc instanceof external_multiple_structure) {
$mult = '<MULTIPLE>'."\n";
foreach ($returns as $val) {
$mult .= self::xmlize_result($val, $desc->content);
if (!empty($returns)) {
foreach ($returns as $val) {
$mult .= self::xmlize_result($val, $desc->content);
}
}
$mult .= '</MULTIPLE>'."\n";
return $mult;
Expand Down

0 comments on commit 17ecdd2

Please sign in to comment.