]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add lower_utf8 selector transformation
authorPavel Podkorytov <pod.pavel@gmail.com>
Sat, 21 May 2022 10:56:28 +0000 (15:56 +0500)
committerPavel Podkorytov <pod.pavel@gmail.com>
Sat, 21 May 2022 11:01:44 +0000 (16:01 +0500)
lualib/lua_selectors/transforms.lua

index 28ae2c315501e472e1047cbfb45dbfe453d79cbe..fc929175f696174a49d6d0e8becd8d07b766c263 100644 (file)
@@ -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'] = {