aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/w3mhelp.cgi.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/w3mhelp.cgi.in')
-rw-r--r--scripts/w3mhelp.cgi.in18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
index 2ced3fc..4351813 100644
--- a/scripts/w3mhelp.cgi.in
+++ b/scripts/w3mhelp.cgi.in
@@ -1,5 +1,5 @@
#!@PERL@
-# $Id: w3mhelp.cgi.in,v 1.16 2002/11/21 16:15:59 ukai Exp $
+# $Id: w3mhelp.cgi.in,v 1.17 2002/11/26 18:03:30 ukai Exp $
if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
$CYGPATH = 1;
@@ -49,6 +49,18 @@ if (defined($ENV{'QUERY_STRING'})) {
$lang = $tlang;
}
}
+ if ($ENV{'QUERY_STRING'} =~ /(^|&)cookie=([^&]*)/) {
+ $cookie = $2;
+ $cookie =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge;
+ }
+}
+if (($cookie eq "") || ($cookie ne $ENV{"LOCAL_COOKIE"})) {
+ print <<EOF;
+Content-Type: text/plain
+
+Local cookie doesn't match: It may be an illegal execution
+EOF
+ exit(1);
}
%f = %keyfunc;
@@ -103,7 +115,9 @@ HEADING
$q_version = $version;
$q_version =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge;
-$script = "<A HREF=\"$ENV{'SCRIPT_NAME'}?version=$q_version&amp;lang=";
+$q_cookie = $cookie;
+$q_cookie =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge;
+$script = "<A HREF=\"$ENV{'SCRIPT_NAME'}?cookie=$q_cookie&version=$q_version&amp;lang=";
# doc:en_English doc-jp:ja_Japanese
for $otherlang (@docdirs) {