]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Get rid of numeric string:match in honor of tonumber
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 13:38:09 +0000 (14:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 13:38:09 +0000 (14:38 +0100)
src/plugins/lua/mime_types.lua

index 6cf306b2bb7ed0e33ec4300928c6738b3461f7dd..24b88da1d3d61f6babe6ae6652c6e5811c2c41ec 100644 (file)
@@ -462,7 +462,7 @@ local function check_mime_type(task)
 
                 if enc_ext
                     and settings['bad_extensions'][enc_ext]
-                    and not string.match(ext2, '^%d+$')
+                    and not tonumber(ext2)
                     and enc_ext ~= ext2 then
                   task:insert_result(settings['symbol_double_extension'], 2.0,
                       string.format("%s!=%s", ext2, enc_ext))