commit c4cdc7a: [Minor] Filter crap from javascript
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Jan 20 13:07:13 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-01-20 12:40:29 +0000
URL: https://github.com/rspamd/rspamd/commit/c4cdc7a35003eafb1baa2a3bf5f1c48d89465e63 (HEAD -> master)
[Minor] Filter crap from javascript
---
lualib/lua_content/pdf.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua
index e64ac86e4..6ede52c76 100644
--- a/lualib/lua_content/pdf.lua
+++ b/lualib/lua_content/pdf.lua
@@ -524,7 +524,7 @@ local function process_action(task, pdf, obj)
if not pdf.scripts then
pdf.scripts = {}
end
- obj.js = rspamd_text.fromstring(js)
+ obj.js = rspamd_text.fromstring(js):exclude_chars('%n%c')
pdf.scripts[#pdf.scripts + 1] = obj.js
lua_util.debugm(N, task, 'extracted javascript from %s:%s: %s',
obj.major, obj.minor, obj.js)
@@ -532,10 +532,10 @@ local function process_action(task, pdf, obj)
if not pdf.scripts then
pdf.scripts = {}
end
- obj.js = js
- pdf.scripts[#pdf.scripts + 1] = js
+ obj.js = js:exclude_chars('%n%c')
+ pdf.scripts[#pdf.scripts + 1] = obj.js
lua_util.debugm(N, task, 'extracted javascript from %s:%s: %s',
- obj.major, obj.minor, js)
+ obj.major, obj.minor, obj.js)
else
lua_util.debugm(N, task, 'invalid type for javascript from %s:%s: %s',
obj.major, obj.minor, js)
More information about the Commits
mailing list