commit 586ba3e8bc0e7451a6fe3d85ef66ede67cd183a5
parent c74d1282729f33e9a1e8bea0960b60e1d68a63bd
Author: ukai <ukai>
Date: Fri, 21 Dec 2001 19:25:01 +0000
more restrict tlang
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
@@ -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)) {