diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-05 15:11:40 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-05 15:11:40 +0100 |
commit | 4fd673f08e5ca4b0a2f4df97043571f5618c4c94 (patch) | |
tree | d8845c542e3a560187f16ac1a4e99f5710695e7d /lualib/lua_content | |
parent | 5dd1ccbb33e53b9a3903970bbd623569869ad008 (diff) | |
download | rspamd-4fd673f08e5ca4b0a2f4df97043571f5618c4c94.tar.gz rspamd-4fd673f08e5ca4b0a2f4df97043571f5618c4c94.zip |
[Minor] Attach pdf urls to mime parts
Diffstat (limited to 'lualib/lua_content')
-rw-r--r-- | lualib/lua_content/pdf.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index fbb7482c1..92b170534 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -1052,7 +1052,7 @@ local function search_text(task, pdf) end -- This function searches objects for `/URI` key and parses it's content -local function search_urls(task, pdf) +local function search_urls(task, pdf, mpart) local function recursive_object_traverse(obj, dict, rec) if rec > 10 then lua_util.debugm(N, task, 'object %s:%s recurses too much', @@ -1071,7 +1071,7 @@ local function search_urls(task, pdf) if url then lua_util.debugm(N, task, 'found url %s in object %s:%s', v, obj.major, obj.minor) - task:inject_url(url) + task:inject_url(url, mpart) end end end @@ -1085,7 +1085,7 @@ local function search_urls(task, pdf) end end -local function process_pdf(input, _, task) +local function process_pdf(input, mpart, task) if not config.enabled then -- Skip processing @@ -1135,7 +1135,7 @@ local function process_pdf(input, _, task) search_text(task, pdf_output) end if config.url_extraction then - search_urls(task, pdf_output) + search_urls(task, pdf_output, mpart) end if config.js_fuzzy and pdf_output.scripts then |