Change 34278 by [EMAIL PROTECTED] on 2008/09/05 17:26:44
Fix a couple of failing CGI.pm tests on Win32
(My temporary directory is C:\DOCUME~1\shay\LOCALS~1\Temp, so we need
to allow ~ characters.)
Affected files ...
... //depot/perl/lib/CGI.pm#81 edit
Differences ...
==== //depot/perl/lib/CGI.pm#81 (text) ====
Index: perl/lib/CGI.pm
--- perl/lib/CGI.pm#80~34208~ 2008-08-20 06:55:37.000000000 -0700
+++ perl/lib/CGI.pm 2008-09-05 10:26:44.000000000 -0700
@@ -3760,7 +3760,7 @@
(my $safename = $name) =~ s/([':%])/ sprintf '%%%02X', ord $1 /eg;
my $fv = ++$FH . $safename;
my $ref = \*{"Fh::$fv"};
- $file =~ m!^([a-zA-Z0-9_\+ \'\":/.\$\\-]+)$! || return;
+ $file =~ m!^([a-zA-Z0-9_\+ \'\":/.\$\\~-]+)$! || return;
my $safe = $1;
sysopen($ref,$safe,Fcntl::O_RDWR()|Fcntl::O_CREAT()|Fcntl::O_EXCL(),0600)
|| return;
unlink($safe) if $delete;
@@ -4086,7 +4086,7 @@
sub DESTROY {
my($self) = @_;
- $$self =~ m!^([a-zA-Z0-9_ \'\":/.\$\\-]+)$! || return;
+ $$self =~ m!^([a-zA-Z0-9_ \'\":/.\$\\~-]+)$! || return;
my $safe = $1; # untaint operation
unlink $safe; # get rid of the file
}
@@ -4107,7 +4107,7 @@
last if ! -f ($filename = sprintf("\%s${SL}CGItemp%d", $TMPDIRECTORY,
$sequence++));
}
# check that it is a more-or-less valid filename
- return unless $filename =~ m!^([a-zA-Z0-9_\+ \'\":/.\$\\-]+)$!;
+ return unless $filename =~ m!^([a-zA-Z0-9_\+ \'\":/.\$\\~-]+)$!;
# this used to untaint, now it doesn't
# $filename = $1;
return bless \$filename;
End of Patch.