prevent publish items with invalid XML schema (EJAB-699)
SVN Revision: 1722
This commit is contained in:
parent
07e9ad307e
commit
e8635b99c8
|
@ -1,3 +1,8 @@
|
|||
2008-12-09 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/mod_pubsub/mod_pubsub.erl: prevent publish items with invalid
|
||||
XML schema bugfix (EJAB-699) (previous commit was uncomplete)
|
||||
|
||||
2008-12-08 Christophe Romain <christophe.romain@process-one.net>
|
||||
|
||||
* src/ejabberd_c2s.erl: Reduce memory consumption due to caps handling
|
||||
|
|
|
@ -1485,7 +1485,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
|
|||
PublishFeature = lists:member("publish", Features),
|
||||
PublishModel = get_option(Options, publish_model),
|
||||
MaxItems = max_items(Options),
|
||||
PayloadCount = payload_elements(xmlelement, Payload),
|
||||
PayloadCount = payload_xmlelements(Payload),
|
||||
PayloadSize = size(term_to_binary(Payload)),
|
||||
PayloadMaxSize = get_option(Options, max_payload_size),
|
||||
% pubsub#deliver_payloads true
|
||||
|
@ -2127,10 +2127,10 @@ is_to_delivered({User, Server, _}, _, true) ->
|
|||
%% Elem = atom()
|
||||
%% Payload = term()
|
||||
%% @doc <p>Count occurence of given element in payload.</p>
|
||||
payload_elements(Elem, Payload) -> payload_elements(Elem, Payload, 0).
|
||||
payload_elements(_, [], Count) -> Count;
|
||||
payload_elements(Elem, [Elem|Tail], Count) -> payload_elements(Elem, Tail, Count+1);
|
||||
payload_elements(Elem, [_|Tail], Count) -> payload_elements(Elem, Tail, Count).
|
||||
payload_xmlelements(Payload) -> payload_xmlelements(Payload, 0).
|
||||
payload_xmlelements([], Count) -> Count;
|
||||
payload_xmlelements([{xmlelement, _, _, _}|Tail], Count) -> payload_xmlelements(Tail, Count+1);
|
||||
payload_xmlelements([_|Tail], Count) -> payload_xmlelements(Tail, Count).
|
||||
|
||||
%%%%%% broadcast functions
|
||||
|
||||
|
|
Loading…
Reference in New Issue