mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
parent
9889c291cc
commit
0f5d76ca74
14 changed files with 284 additions and 31 deletions
|
|
@ -593,7 +593,22 @@ network_alert_functions_description = {
|
|||
|
||||
function noHtml(s)
|
||||
if s == nil then return nil end
|
||||
return s:gsub("<.->(.-)</.->","%1"):gsub("^%s*(.-)%s*$", "%1")
|
||||
local cleaned = s:gsub("<[aA].->(.-)</[aA]>","%1")
|
||||
:gsub("<[iI].->(.-)</[iI]>","%1")
|
||||
:gsub("<.->(.-)</.->","%1") -- note: this does not handle nested tags
|
||||
:gsub("^%s*(.-)%s*$", "%1")
|
||||
return cleaned
|
||||
end
|
||||
|
||||
function unescapeHtmlEntities(str)
|
||||
str = string.gsub( str, '<', '<' )
|
||||
str = string.gsub( str, '>', '>' )
|
||||
str = string.gsub( str, '"', '"' )
|
||||
str = string.gsub( str, ''', "'" )
|
||||
str = string.gsub( str, '&#(%d+);', function(n) return string.char(n) end )
|
||||
str = string.gsub( str, '&#x(%d+);', function(n) return string.char(tonumber(n,16)) end )
|
||||
str = string.gsub( str, '&', '&' ) -- Be sure to do this after all others
|
||||
return str
|
||||
end
|
||||
|
||||
function alertSeverityLabel(v, nohtml)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue