Software /
code /
prosody-modules
Changeset
3648:aa12b95a6d36
mod_http_upload: Ensure integer formatting of size limit
Prevents problems when running under Lua 5.3+ where floating point
numbers always have a decimal dot when tostring()-ed.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 22 Aug 2019 23:57:57 +0200 |
parents | 3647:a0ca5d0a49ba |
children | 3649:d252c8573f33 |
files | mod_http_upload/mod_http_upload.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua Wed Aug 21 00:38:20 2019 +0200 +++ b/mod_http_upload/mod_http_upload.lua Thu Aug 22 23:57:57 2019 +0200 @@ -93,12 +93,12 @@ module:add_extension(dataform { { name = "FORM_TYPE", type = "hidden", value = namespace }, { name = "max-file-size", type = "text-single" }, -}:form({ ["max-file-size"] = tostring(file_size_limit) }, "result")); +}:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result")); module:add_extension(dataform { { name = "FORM_TYPE", type = "hidden", value = legacy_namespace }, { name = "max-file-size", type = "text-single" }, -}:form({ ["max-file-size"] = tostring(file_size_limit) }, "result")); +}:form({ ["max-file-size"] = ("%d"):format(file_size_limit) }, "result")); -- state local pending_slots = module:shared("upload_slots");