[VS] Fix notification format.

This commit is contained in:
Nicolo Maio 2023-10-27 17:02:17 +02:00
parent f222e3ccdf
commit e2e49ef3e3
2 changed files with 23 additions and 3 deletions

View file

@ -501,6 +501,18 @@ end
-- ######################################################
local function format_no_html_vs_report_message(message)
local formatted_message = message
formatted_message = formatted_message:gsub("<br>", "")
formatted_message = formatted_message:gsub("</br>","\n")
formatted_message = formatted_message:gsub("<a href='","")
formatted_message = formatted_message:gsub("'>","")
formatted_message = formatted_message:gsub("</a>","")
return formatted_message
end
-- ######################################################
-- This is a basic function used to format notifications
local function format_notification(notification, options)
local message = notification.message or ""
@ -511,6 +523,14 @@ local function format_notification(notification, options)
message = format_report_email(notification)
end
if (notification.notification_type == "vulnerability_scans") then
if(not options or not options.nohtml) then
-- nothing to do
else
message = format_no_html_vs_report_message(message)
end
end
return message
end