# HG changeset patch # User Kim Alvefur # Date 1566511077 -7200 # Node ID aa12b95a6d36a3a7bf511e7384e1d7f62b818e21 # Parent a0ca5d0a49bae9490c6083c275e588e299a3e0a6 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. diff -r a0ca5d0a49ba -r aa12b95a6d36 mod_http_upload/mod_http_upload.lua --- 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");