mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-08 09:40:57 +01:00
Fix HTML generation in 3.0
This commit applies the same changes as #1481, but to the 3.0 branch.
This commit is contained in:
parent
4dbd9a98ba
commit
53f0bec0ba
17
testssl.sh
17
testssl.sh
@ -487,12 +487,12 @@ 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//&/&}"
|
||||||
output="${output//</\<}"
|
output="${output//</<}"
|
||||||
output="${output//>/\>}"
|
output="${output//>/>}"
|
||||||
output="${output//\"/\"}"
|
output="${output//\"/"}"
|
||||||
output="${output//\'/\'}"
|
output="${output//\'/'}"
|
||||||
tm_out "$output"
|
printf -- "%s" "$output"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,8 +507,9 @@ safe_echo() { printf -- "%b" "${1//%/%%}"; }
|
|||||||
tm_out() { printf -- "%b" "${1//%/%%}"; }
|
tm_out() { printf -- "%b" "${1//%/%%}"; }
|
||||||
tmln_out() { printf -- "%b" "${1//%/%%}\n"; }
|
tmln_out() { printf -- "%b" "${1//%/%%}\n"; }
|
||||||
|
|
||||||
out() { printf -- "%b" "${1//%/%%}"; html_out "$1"; }
|
out() { printf -- "%b" "${1//%/%%}"; html_out "$(html_reserved "$1")"; }
|
||||||
outln() { printf -- "%b" "${1//%/%%}\n"; html_out "$1\n"; }
|
outln() { printf -- "%b" "${1//%/%%}\n"; html_out "$(html_reserved "$1")\n"; }
|
||||||
|
|
||||||
|
|
||||||
#TODO: Still no shell injection safe but if just run it from the cmd line: that's fine
|
#TODO: Still no shell injection safe but if just run it from the cmd line: that's fine
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user