mirror of
https://github.com/TangentFoxy/lovebird.git
synced 2025-12-18 18:06:43 +00:00
Fixed lovebird.htmlescape() to escape &, " and '
This commit is contained in:
@@ -497,8 +497,15 @@ function lovebird.parseurl(url)
|
||||
end
|
||||
|
||||
|
||||
local htmlescapemap = {
|
||||
["<"] = "<",
|
||||
["&"] = "&",
|
||||
['"'] = """,
|
||||
["'"] = "'",
|
||||
}
|
||||
|
||||
function lovebird.htmlescape(str)
|
||||
return ( str:gsub("<", "<") )
|
||||
return ( str:gsub("[<&\"']", htmlescapemap) )
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user