mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
[VS] Fix notification format.
This commit is contained in:
parent
f222e3ccdf
commit
e2e49ef3e3
2 changed files with 23 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue