aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-21 19:25:01 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-21 19:25:01 +0000
commit2fbb225236f506dddee2dd269fa52eb30a5b739d (patch)
treede4482a9ae9253bf5776baaf7f110b0d8afd51a4 /scripts
parentmore restrict tlang (diff)
downloadw3m-2fbb225236f506dddee2dd269fa52eb30a5b739d.tar.gz
w3m-2fbb225236f506dddee2dd269fa52eb30a5b739d.zip
more restrict tlang
Diffstat (limited to '')
-rw-r--r--scripts/w3mhelp.cgi.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
index 87ab916..0cf4a5b 100644
--- a/scripts/w3mhelp.cgi.in
+++ b/scripts/w3mhelp.cgi.in
@@ -1,5 +1,5 @@
#!@PERL@
-# $Id: w3mhelp.cgi.in,v 1.5 2001/12/21 19:21:13 ukai Exp $
+# $Id: w3mhelp.cgi.in,v 1.6 2001/12/21 19:25:01 ukai Exp $
$helpdir = "@HELP_DIR@";
unshift(@INC, $helpdir);
@@ -28,7 +28,9 @@ if (defined($ENV{'QUERY_STRING'})) {
local($tlang) = $2;
$tlang =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge;
$tlang =~ tr/A-Z/a-z/;
- $tlang =~ s/([a-z][a-z]).*/$1/; # lang code is 'en', 'ja', ...
+ if ($tlang !~ /^[a-z][a-z]$/) {
+ $tlang = 'en';
+ }
print "tlang=$tlang\n";
eval {require "w3mhelp-funcdesc.$tlang.pl";};
if (defined(%funcdesc)) {