25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Preserve correct order of deserialized XML elements

Fixes #1939
This commit is contained in:
Evgeniy Khramtsov 2017-08-18 10:20:27 +03:00
parent 793ca45dda
commit ee0a8d2966

View File

@ -518,5 +518,5 @@ deserialize([{_, S}|T], #xmlel{children = Els} = El, Acc) when is_binary(S) ->
deserialize(T, El#xmlel{children = [{xmlcdata, S}|Els]}, Acc);
deserialize([{_, L}|T], #xmlel{children = Els} = El, Acc) when is_list(L) ->
deserialize(T, El#xmlel{children = deserialize(L) ++ Els}, Acc);
deserialize([], El, Acc) ->
[El|Acc].
deserialize([], #xmlel{children = Els} = El, Acc) ->
[El#xmlel{children = lists:reverse(Els)}|Acc].