diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-31 14:39:31 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-31 14:39:31 -0800 |
commit | caec0c476de8c0f337c58b049b9a4360aa593706 (patch) | |
tree | 13212f0fe3914eb1ac23912dd8d3dd5215b9bdcf /lib/api.php | |
parent | a9e1c9bf6d65d3f7613a40c99ec34caec19d26e3 (diff) | |
parent | b26279546c78618b167e4a8e7a4a10db01c7d479 (diff) | |
download | nextcloud-server-caec0c476de8c0f337c58b049b9a4360aa593706.tar.gz nextcloud-server-caec0c476de8c0f337c58b049b9a4360aa593706.zip |
Merge pull request #1287 from owncloud/ocs_xml_attributes
API: Treat array keys starting with '@' as XML attributes
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api.php b/lib/api.php index 545b55757ff..abf1c3b0036 100644 --- a/lib/api.php +++ b/lib/api.php @@ -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(); |