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