commit daa76dc: [Minor] Lua_content: Support javascript PDF elements

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Nov 27 13:42:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-11-27 13:22:18 +0000
URL: https://github.com/rspamd/rspamd/commit/daa76dc2e137c97d7329f553d708053f332ee95e

[Minor] Lua_content: Support javascript PDF elements

---
 lualib/lua_content/pdf.lua | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua
index 3ff9f0f64..e8d4c7bab 100644
--- a/lualib/lua_content/pdf.lua
+++ b/lualib/lua_content/pdf.lua
@@ -29,6 +29,12 @@ local pdf_patterns = {
     patterns = {
       [[\ntrailer\r?\n]]
     }
+  },
+  javascript = {
+    patterns = {
+      [[\s/JS]],
+      [[\s/JavaScript]],
+    }
   }
 }
 
@@ -128,6 +134,11 @@ processors.trailer = function(input, task, positions, output)
   end
 end
 
+processors.javascript = function(_, task, _, output)
+  lua_util.debugm(N, task, "pdf: found javascript tag")
+  output.javascript = true
+end
+
 exports.process = process_pdf
 
 return exports
\ No newline at end of file


More information about the Commits mailing list