aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors
diff options
context:
space:
mode:
authorPavel Podkorytov <pod.pavel@gmail.com>2022-05-21 15:56:28 +0500
committerPavel Podkorytov <pod.pavel@gmail.com>2022-05-21 16:01:44 +0500
commit434c20235f6a6822cc079e5fc51bd359715251b5 (patch)
tree79b873fdf73e10bedabb5d40dda582656786b18c /lualib/lua_selectors
parentf0c746420bb4e979800bdc11ec6d8d4e6ef10c06 (diff)
downloadrspamd-434c20235f6a6822cc079e5fc51bd359715251b5.tar.gz
rspamd-434c20235f6a6822cc079e5fc51bd359715251b5.zip
[Minor] Add lower_utf8 selector transformation
Diffstat (limited to 'lualib/lua_selectors')
-rw-r--r--lualib/lua_selectors/transforms.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua
index 28ae2c315..fc929175f 100644
--- a/lualib/lua_selectors/transforms.lua
+++ b/lualib/lua_selectors/transforms.lua
@@ -40,6 +40,17 @@ local transform_function = {
end,
['description'] = 'Returns the lowercased string',
},
+ -- Returns the lowercased utf8 string
+ ['lower_utf8'] = {
+ ['types'] = {
+ ['string'] = true,
+ },
+ ['map_type'] = 'string',
+ ['process'] = function(inp, t)
+ return rspamd_util.lower_utf8(inp), t
+ end,
+ ['description'] = 'Returns the lowercased utf8 string',
+ },
-- Returns the first element
['first'] = {
['types'] = {