summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-06-18 19:07:45 +0100
committerJoe Carstairs <me@joeac.net>2026-06-18 19:07:45 +0100
commit2328446520781f21f65e290b938f7c13d0533943 (patch)
tree3060ed756b5d70fba96400007d3477e8c993e15f
parentaf4adc0fc87a811828a510b9a27b71b2472e5438 (diff)
more sophisticated escape_upphtml in gmi2upphtml
-rwxr-xr-xhttp/bin/gmi2upphtml9
1 files changed, 8 insertions, 1 deletions
diff --git a/http/bin/gmi2upphtml b/http/bin/gmi2upphtml
index b43693d..1631037 100755
--- a/http/bin/gmi2upphtml
+++ b/http/bin/gmi2upphtml
@@ -53,7 +53,14 @@ close_all_open_blocks()
escape_upphtml()
{
- echo "$1" | sed "s/\`/\\\\\`/g" | sed "s/\"/\\\\\"/g" | sed "s/\\\$/\\\\\$/g"
+ echo "$1" \
+ | sed "s/&/\\&amp;/g" \
+ | sed "s/</\\&lt;/g" \
+ | sed "s/>/\\&gt;/g" \
+ | sed "s/\"/\\&quot;/g" \
+ | sed "s/'/\\&#x27;/g" \
+ | sed "s/\`/\\&#x60;/g" \
+ | sed "s/\\\$/\\\\\$/g"
}
close_all_open_blocks_except()