Skip to content
Snippets Groups Projects
Commit caec0c47 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #1287 from owncloud/ocs_xml_attributes

API: Treat array keys starting with '@' as XML attributes
parents a9e1c9bf b2627954
Branches
No related tags found
No related merge requests found
......@@ -188,7 +188,10 @@ class OC_API {
private static function toXML($array, $writer) {
foreach($array as $k => $v) {
if (is_numeric($k)) {
if ($k[0] === '@') {
$writer->writeAttribute(substr($k, 1), $v);
continue;
} else if (is_numeric($k)) {
$k = 'element';
}
if(is_array($v)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment