Merge pull request #2318 from dcooper16/fix_html_30

Fix HTML output in Bash 5.2 and newer
This commit is contained in:
Dirk Wetter 2023-02-04 09:24:07 +01:00 committed by GitHub
commit 4a2b258425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,11 +491,11 @@ html_reserved(){
local output
"$do_html" || return 0
#sed -e 's/\&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\&apos;/g" <<< "$1"
output="${1//&/&amp;}"
output="${output//</&lt;}"
output="${output//>/&gt;}"
output="${output//\"/&quot;}"
output="${output//\'/&apos;}"
output="${1//&/$'&'amp;}"
output="${output//</$'&'lt;}"
output="${output//>/$'&'gt;}"
output="${output//\"/$'&'quot;}"
output="${output//\'/$'&'apos;}"
printf -- "%s" "$output"
return 0
}