25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-10 15:47:30 +01:00

Fix format_result also in xmlrpc, after aa5caa3 (#982)

This commit is contained in:
Badlop 2016-03-07 17:34:08 +01:00
parent 6e14a47316
commit 16c1b9a5c2

View File

@ -491,7 +491,7 @@ format_result(Atom, {Name, atom}) ->
[{Name, iolist_to_binary(atom_to_list(Atom))}]}; [{Name, iolist_to_binary(atom_to_list(Atom))}]};
format_result(Int, {Name, integer}) -> format_result(Int, {Name, integer}) ->
{struct, [{Name, Int}]}; {struct, [{Name, Int}]};
format_result(String, {Name, string}) when is_list(String) -> format_result([A|_]=String, {Name, string}) when is_list(String) and is_integer(A) ->
{struct, [{Name, lists:flatten(String)}]}; {struct, [{Name, lists:flatten(String)}]};
format_result(Binary, {Name, string}) when is_binary(Binary) -> format_result(Binary, {Name, string}) when is_binary(Binary) ->
{struct, [{Name, binary_to_list(Binary)}]}; {struct, [{Name, binary_to_list(Binary)}]};