Mercurial > prosody-modules
comparison mod_firewall/conditions.lib.lua @ 3973:df6227e288e5
mod_firewall: Fix use of unpack() on Lua 5.3
unpack() was previously a global function, it moved into the table
library in either Lua 5.2 or 5.3
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 13 Apr 2020 21:53:01 +0200 |
| parents | b0d92332b87f |
| children | ab065ff4628b |
comparison
equal
deleted
inserted
replaced
| 3972:45c5603a6c07 | 3973:df6227e288e5 |
|---|---|
| 1 --luacheck: globals meta idsafe | 1 --luacheck: globals meta idsafe |
| 2 local condition_handlers = {}; | 2 local condition_handlers = {}; |
| 3 | 3 |
| 4 local jid = require "util.jid"; | 4 local jid = require "util.jid"; |
| 5 local unpack = table.unpack or unpack; | |
| 5 | 6 |
| 6 -- Helper to convert user-input strings (yes/true//no/false) to a bool | 7 -- Helper to convert user-input strings (yes/true//no/false) to a bool |
| 7 local function string_to_boolean(s) | 8 local function string_to_boolean(s) |
| 8 s = s:lower(); | 9 s = s:lower(); |
| 9 return s == "yes" or s == "true"; | 10 return s == "yes" or s == "true"; |
