In Mac OS 10.5 (Leopard) the temporary directory may have a '+' in its name - which breaks a
couple of checks in CGI.pm. The attached patch allows all tests to pass on Leopard.
Subject: | cgi-pm-leopard.patch |
--- CGI.pm-3.29-orig/CGI.pm 2007-11-05 21:26:33.000000000 +0000
+++ CGI.pm-3.29/CGI.pm 2007-11-05 21:37:01.000000000 +0000
@@ -3696,7 +3696,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;
@@ -4035,7 +4035,7 @@
last if ! -f ($filename = sprintf("${TMPDIRECTORY}${SL}CGItemp%d",$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;