From: Steve Hay Date: Fri, 5 Sep 2008 17:26:44 +0000 (+0000) Subject: Fix a couple of failing CGI.pm tests on Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=598d6e99fadb6f0e660491546091a7130ff8a2e9;p=p5sagit%2Fp5-mst-13.2.git 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.) p4raw-id: //depot/perl@34278 --- diff --git a/lib/CGI.pm b/lib/CGI.pm index 5196528..c4ee7bf 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -3760,7 +3760,7 @@ sub new { (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 @@ $MAXTRIES = 5000; 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 @@ sub new { 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;