Mercurial > prosody-modules
comparison mod_firewall/actions.lib.lua @ 6509:f61564e11d3b
various: Adjust for loop variables becoming constants in Lua 5.5
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 07 Apr 2026 14:30:31 +0200 |
| parents | 1ac4a59ac575 |
| children | de1f17ed4dac |
comparison
equal
deleted
inserted
replaced
| 6508:3044e14fcaa0 | 6509:f61564e11d3b |
|---|---|
| 10 -- Takes an XML string and returns a code string that builds that stanza | 10 -- Takes an XML string and returns a code string that builds that stanza |
| 11 -- using st.stanza() | 11 -- using st.stanza() |
| 12 local function compile_xml(data) | 12 local function compile_xml(data) |
| 13 local code = {}; | 13 local code = {}; |
| 14 local first, short_close = true, nil; | 14 local first, short_close = true, nil; |
| 15 for tagline, text in data:gmatch("<([^>]+)>([^<]*)") do | 15 for _, tagline, text in data:gmatch("()<([^>]+)>([^<]*)") do |
| 16 if tagline:sub(-1,-1) == "/" then | 16 if tagline:sub(-1,-1) == "/" then |
| 17 tagline = tagline:sub(1, -2); | 17 tagline = tagline:sub(1, -2); |
| 18 short_close = true; | 18 short_close = true; |
| 19 end | 19 end |
| 20 if tagline:sub(1,1) == "/" then | 20 if tagline:sub(1,1) == "/" then |
