Improve _htmlEscape function robustness by using printf instead of echo

small commit to trigger github actions
This commit is contained in:
Robert Rettig
2025-12-19 18:02:18 +01:00
parent 1c65c04b54
commit 27ebf09c5c

View File

@@ -172,10 +172,10 @@ _inwx_check_cookie() {
_htmlEscape() { _htmlEscape() {
_s="$1" _s="$1"
_s=$(echo "$_s" | sed "s/&/&/g") _s=$(printf '%s' "$_s" | sed "s/&/&/g")
_s=$(echo "$_s" | sed "s/</\&lt;/g") _s=$(printf '%s' "$_s" | sed "s/</\&lt;/g")
_s=$(echo "$_s" | sed "s/>/\&gt;/g") _s=$(printf '%s' "$_s" | sed "s/>/\&gt;/g")
_s=$(echo "$_s" | sed 's/"/\&quot;/g') _s=$(printf '%s' "$_s" | sed 's/"/\&quot;/g')
printf -- %s "$_s" printf -- %s "$_s"
} }