mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-27 12:04:21 +00:00
Fixed lovebird.htmlescape() to escape &
, "
and '
This commit is contained in:
parent
c8c5ed07a5
commit
1c88d17a91
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user