aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-01-06 13:07:22 +0100
committerKim Alvefur <zash@zash.se>2017-01-06 13:07:22 +0100
commit1f2b72e2ca01b540054d5b245bf7d07870d42baf (patch)
treebcd241dc788a3e45a9b7e1f8a057ed1633366be5
parent9f2191c8dc626139439ce20d54af2b6a3c55f028 (diff)
downloadprosody-1f2b72e2ca01b540054d5b245bf7d07870d42baf.tar.gz
prosody-1f2b72e2ca01b540054d5b245bf7d07870d42baf.zip
mod_register: Strip '+' char from field names without using length
-rw-r--r--plugins/mod_register.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index f89efe20..7a57d65b 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -64,7 +64,7 @@ for _, field in ipairs(additional_fields) do
registration_form[#registration_form + 1] = field;
else
if field:match("%+$") then
- field = field:sub(1, #field - 1);
+ field = field:sub(1, -2);
field_map[field].required = true;
end