mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-01 06:19:44 +01:00
Merge pull request #2317 from dcooper16/fix_html
Fix HTML output in Bash 5.2 and newer
This commit is contained in:
commit
05b4cdcc0d
10
testssl.sh
10
testssl.sh
@ -535,11 +535,11 @@ html_reserved(){
|
|||||||
local output
|
local output
|
||||||
"$do_html" || return 0
|
"$do_html" || return 0
|
||||||
#sed -e 's/\&/\&/g' -e 's/</\</g' -e 's/>/\>/g' -e 's/"/\"/g' -e "s/'/\'/g" <<< "$1"
|
#sed -e 's/\&/\&/g' -e 's/</\</g' -e 's/>/\>/g' -e 's/"/\"/g' -e "s/'/\'/g" <<< "$1"
|
||||||
output="${1//&/&}"
|
output="${1//&/$'&'amp;}"
|
||||||
output="${output//</<}"
|
output="${output//</$'&'lt;}"
|
||||||
output="${output//>/>}"
|
output="${output//>/$'&'gt;}"
|
||||||
output="${output//\"/"}"
|
output="${output//\"/$'&'quot;}"
|
||||||
output="${output//\'/'}"
|
output="${output//\'/$'&'apos;}"
|
||||||
printf -- "%s" "$output"
|
printf -- "%s" "$output"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user