]> git.mxchange.org Git - friendica.git/commitdiff
API: Fix `api_array_to_xml()`
authorfabrixxm <fabrix.xm@gmail.com>
Wed, 13 Jul 2016 16:35:55 +0000 (18:35 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Wed, 13 Jul 2016 17:11:10 +0000 (19:11 +0200)
include/api.php

index c86a3cbe4bc3295cee41b37c79643a90c12e7d1f..9b245a73ee96c05232cdd0b2056fbc90005fed66 100644 (file)
        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</$ename>";
                }