diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-29 09:30:45 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-29 09:30:45 +0200 |
| commit | 1a7a5ad9e8cb6300b6ec9c1d8a0e90f7b7e0aff7 (patch) | |
| tree | b908e46e7029435bfd91b6e3a4da34d4572c7bae | |
| parent | 004c4c3fd7b367828533821995bae2771ba23672 (diff) | |
HTML-escape command outputs for W3C compliance
Amp-Thread-ID: https://ampcode.com/threads/T-019c086d-c760-779d-b740-0f748094b62a
Co-authored-by: Amp <amp@ampcode.com>
| -rw-r--r-- | docker-image/Justfile | 2 | ||||
| -rw-r--r-- | docker-image/index.pl | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/docker-image/Justfile b/docker-image/Justfile index 6c5131f..f50ecca 100644 --- a/docker-image/Justfile +++ b/docker-image/Justfile @@ -1,4 +1,4 @@ -VERSION := "1.4.0" +VERSION := "1.5.0" REGISTRY := "registry.lan.buetow.org:30001" IMAGE := "ipv6test" diff --git a/docker-image/index.pl b/docker-image/index.pl index c5744d8..6380748 100644 --- a/docker-image/index.pl +++ b/docker-image/index.pl @@ -54,12 +54,20 @@ print "<pre>You are using <b>" . do { } . "</b>\n"; -chomp (my $remote = `host $ENV{REMOTE_ADDR}`); -chomp (my $server = `host $ENV{SERVER_ADDR}`); -chomp (my $server0 = `host $ENV{SERVER_NAME}`); -chomp (my $digremote = `dig -x $ENV{REMOTE_ADDR}`); -chomp (my $digserver = `dig -x $ENV{SERVER_ADDR}`); -chomp (my $digserver0 = `dig -t any $ENV{SERVER_NAME}`); +sub html_escape { + my $str = shift; + $str =~ s/&/&/g; + $str =~ s/</</g; + $str =~ s/>/>/g; + return $str; +} + +chomp (my $remote = html_escape(`host $ENV{REMOTE_ADDR}`)); +chomp (my $server = html_escape(`host $ENV{SERVER_ADDR}`)); +chomp (my $server0 = html_escape(`host $ENV{SERVER_NAME}`)); +chomp (my $digremote = html_escape(`dig -x $ENV{REMOTE_ADDR}`)); +chomp (my $digserver = html_escape(`dig -x $ENV{SERVER_ADDR}`)); +chomp (my $digserver0 = html_escape(`dig -t any $ENV{SERVER_NAME}`)); print <<END; Client address: $ENV{REMOTE_ADDR} |
