Skip to content

Commit 05b4cdc

Browse files
authored
Merge pull request #2317 from dcooper16/fix_html
Fix HTML output in Bash 5.2 and newer
2 parents 70237b2 + 3d82f7c commit 05b4cdc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

testssl.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,11 @@ html_reserved(){
535535
local output
536536
"$do_html" || return 0
537537
#sed -e 's/\&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\&apos;/g" <<< "$1"
538-
output="${1//&/&amp;}"
539-
output="${output//</&lt;}"
540-
output="${output//>/&gt;}"
541-
output="${output//\"/&quot;}"
542-
output="${output//\'/&apos;}"
538+
output="${1//&/$'&'amp;}"
539+
output="${output//</$'&'lt;}"
540+
output="${output//>/$'&'gt;}"
541+
output="${output//\"/$'&'quot;}"
542+
output="${output//\'/$'&'apos;}"
543543
printf -- "%s" "$output"
544544
return 0
545545
}

0 commit comments

Comments
 (0)