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
No related branches found
No related tags found
No related merge requests found
......@@ -188,10 +188,13 @@ 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)) {
if(is_array($v)) {
$writer->startElement($k);
self::toXML($v, $writer);
$writer->endElement();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment