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

Fix crash when user publishes an item (EJAB-1457)

This commit is contained in:
Badlop 2011-06-01 23:22:25 +02:00
parent 529ab22a79
commit 33544569fb

View File

@ -2024,8 +2024,8 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
DeliverPayloads = get_option(Options, deliver_payloads),
PersistItems = get_option(Options, persist_items),
MaxItems = case PersistItems of
0 -> 0;
1 -> max_items(Host, Options)
false -> 0;
true -> max_items(Host, Options)
end,
PayloadCount = payload_xmlelements(Payload),
PayloadSize = size(term_to_binary(Payload))-2, % size(term_to_binary([])) == 2