aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_protocols/rest_encoder.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2013-05-18 03:58:36 +0000
committerrvelices <rv-github@modusoptimus.com>2013-05-18 03:58:36 +0000
commit8083ba10ecc3d6dd028142888c25830ea879ee3f (patch)
tree8a9c3dcde3f6d3e61e2ab6b87c5723ffdd6557c1 /include/ws_protocols/rest_encoder.php
parentac75099200ad1ca0638b16a1bddd265aa462e75a (diff)
bug 2900: Improve web service output
git-svn-id: http://piwigo.org/svn/trunk@22729 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/ws_protocols/rest_encoder.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/ws_protocols/rest_encoder.php b/include/ws_protocols/rest_encoder.php
index 5f86acb6d..c02d18222 100644
--- a/include/ws_protocols/rest_encoder.php
+++ b/include/ws_protocols/rest_encoder.php
@@ -226,11 +226,9 @@ class PwgRestEncoder extends PwgResponseEncoder
continue;
if ( is_null($value) )
continue; // null means we dont put it
- if ($name!=WS_XML_CONTENT)
- $this->_writer->start_element($name);
+ $this->_writer->start_element($name);
$this->encode($value);
- if ($name!=WS_XML_CONTENT)
- $this->_writer->end_element($name);
+ $this->_writer->end_element($name);
}
}
@@ -270,7 +268,7 @@ class PwgRestEncoder extends PwgResponseEncoder
$this->encode_array($data->_content, $data->_itemName, $data->_xmlAttributes);
break;
case 'pwgnamedstruct':
- $this->encode_array( array($data->_content), $data->_name, $data->_xmlAttributes);
+ $this->encode_struct($data->_content, false, $data->_xmlAttributes);
break;
default:
$this->encode_struct(get_object_vars($data), true);