aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorTarmo Oja <tarmo.oja@cyber.ee>2024-08-23 15:00:27 +0300
committerTarmo Oja <tarmo.oja@cyber.ee>2024-08-23 15:00:27 +0300
commitb37440609e71c21b7b3f225dcaf021b53c7d078c (patch)
tree78d581330b3bc423d0cb9f59a2ebe3ba4c1dcfe4 /lualib
parent0f2d38dea046cfdfc6267a74625ce45be3f6d21c (diff)
downloadrspamd-b37440609e71c21b7b3f225dcaf021b53c7d078c.tar.gz
rspamd-b37440609e71c21b7b3f225dcaf021b53c7d078c.zip
handle nil
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_util.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index 8f44e25f2..88599407c 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -1696,6 +1696,9 @@ exports.join_path = join_path
--
---]]]
local function url_encode_string(str)
+ if str == nil then
+ return ''
+ end
str = string.gsub(str, "([^%w _%%%-%.~])",
function(c)
return string.format("%%%02X", string.byte(c))