Merge pull request #2699 from fabrixxm/fix_pr_2682

Quick fix to PR #2682
This commit is contained in:
Michael Vogel 2016-08-02 12:51:39 +02:00 committed by GitHub
commit 2faf35f5c2
2 changed files with 18 additions and 12 deletions

View File

@ -768,6 +768,7 @@
}
$data3 = array($root_element => $data2);
$ret = xml::from_array($data3, $xml, false, $namespaces);
return $ret;
}
@ -2377,9 +2378,9 @@
$res = array();
$uri = $item['uri']."-l";
foreach($activities as $k => $v) {
$res[$k] = ( x($v,$uri) ? array_map("api_contactlink_to_array", $v[$uri]) : array() );
$res[$k] = (x($v,$uri)?count($v[$uri]):0);
#$res[$k] = ( x($v,$uri) ? array_map("api_contactlink_to_array", $v[$uri]) : array() );
}
return $res;
}

View File

@ -51,8 +51,13 @@ class xml {
$element = $xml;
if (is_integer($key)) {
if (isset($element))
if (isset($element)) {
if (is_scalar($value)) {
$element[0] = $value;
} else {
/// @todo: handle nested array values
}
}
continue;
}