mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-28 11:56:03 +00:00
feat: Add escapeHTML function (#1303)
This commit is contained in:
+2
-1
@@ -11,8 +11,9 @@ escape() {
|
||||
s=${s//</\<}
|
||||
s=${s//>/\>}
|
||||
s=${s//'"'/\"}
|
||||
s=${s//"'"/\'}
|
||||
|
||||
printf -- %s "$s"
|
||||
printf '%s' "$s"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -373,6 +373,18 @@ escape () {
|
||||
return 0
|
||||
}
|
||||
|
||||
escapeXML() {
|
||||
|
||||
printf '%s' "$1" | sed \
|
||||
-e 's/&/\&/g' \
|
||||
-e 's/</\</g' \
|
||||
-e 's/>/\>/g' \
|
||||
-e 's/"/\"/g' \
|
||||
-e "s/'/\'/g"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
html() {
|
||||
|
||||
local title
|
||||
|
||||
Reference in New Issue
Block a user