25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

iq_query_info/1 now returns 'invalid' if XMLNS is invalid

SVN Revision: 2953
This commit is contained in:
Evgeniy Khramtsov 2010-02-02 12:20:19 +00:00
parent 46c667c567
commit d9e345a4d8

View File

@ -382,7 +382,7 @@ iq_info_internal({xmlelement, Name, Attrs, Els}, Filter) when Name == "iq" ->
"result" -> {result, reply};
"error" -> {error, reply};
_ -> {invalid, invalid}
end,
end,
if
Type1 == invalid ->
invalid;
@ -404,22 +404,26 @@ iq_info_internal({xmlelement, Name, Attrs, Els}, Filter) when Name == "iq" ->
<- FilteredEls,
SubName /= "error"],
{case NonErrorEls of
[NonErrorEl] -> xml:get_tag_attr_s("xmlns", NonErrorEl);
_ -> invalid
[NonErrorEl] ->
xml:get_tag_attr_s("xmlns", NonErrorEl);
_ ->
invalid
end,
FilteredEls};
_ ->
{invalid, invalid}
{invalid, []}
end,
if XMLNS == "", Class == request ->
invalid;
XMLNS == invalid ->
invalid;
true ->
#iq{id = ID,
type = Type1,
xmlns = XMLNS,
lang = Lang,
#iq{id = ID,
type = Type1,
xmlns = XMLNS,
lang = Lang,
sub_el = SubEl}
end;
end;
Class == reply, Filter /= any ->
reply
end;