From 95b7de631321a7b61b7e1524abe0a42980435d5f Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Wed, 13 Jul 2016 18:35:55 +0200 Subject: [PATCH] API: Fix `api_array_to_xml()` --- include/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index c86a3cbe4b..9b245a73ee 100644 --- a/include/api.php +++ b/include/api.php @@ -688,8 +688,9 @@ function api_array_to_xml($data, $ename="") { $attrs=""; $childs=""; - if (count($data)==1 && !is_array($data[0])) { + if (count($data)==1 && !is_array($data[array_keys($data)[0]])) { $ename = array_keys($data)[0]; + $ename = trim($ename,'$'); $v = $data[$ename]; return "<$ename>$v"; } -- 2.39.5