mod_blocking: Fix to iterate over blocklist correctly when removing a JID
authorMatthew Wild <mwild1@gmail.com>
Mon, 14 Jun 2010 12:26:25 +0100
changeset 177 bcd7dc51a5e3
parent 176 26bb69a57749
child 178 62f47a93b5b7
mod_blocking: Fix to iterate over blocklist correctly when removing a JID
mod_blocking/mod_blocking.lua
--- a/mod_blocking/mod_blocking.lua	Mon Jun 14 12:25:53 2010 +0100
+++ b/mod_blocking/mod_blocking.lua	Mon Jun 14 12:26:25 2010 +0100
@@ -71,7 +71,7 @@
 	if not default_list then return; end
 	local items = default_list.items;
 	local item;
-	for i=#items,1 do -- order must be unique
+	for i=#items,1,-1 do -- order must be unique
 		item = items[i];
 		if item.type == "jid" and item.action == "deny" then
 			table.remove(items, i);