Here's a bit more complete patch, as well as a patch for the
documentation.
From d2d947ab632d48890797506dbc1d8f7dcfa3d463 Mon Sep 17 00:00:00 2001
From: Christian Walde <walde.christian@googlemail.com>
Date: Thu, 7 Oct 2010 20:44:03 +0200
Subject: [PATCH 4/4] added documentation on how to get support and contribute
---
dist.ini | 6 ++++++
lib/HTTP/Body.pm | 14 ++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/dist.ini b/dist.ini
index 7e3b8da..a16a8ec 100644
--- a/dist.ini
+++ b/dist.ini
@@ -19,3 +19,9 @@ IO::File = 1.14
[Prereqs / TestRequires]
Test::More = 0.86
Test::Deep = 0
+
+[MetaResources]
+repository.web =
http://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/
+repository.url =
https://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/
+repository.type = svn
+x_mailing_list =
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
diff --git a/lib/HTTP/Body.pm b/lib/HTTP/Body.pm
index eb096b1..a432ae2 100644
--- a/lib/HTTP/Body.pm
+++ b/lib/HTTP/Body.pm
@@ -390,6 +390,20 @@ sub tmpdir {
=back
+=head1 SUPPORT
+
+Since its original creation this module has been taken over by the Catalyst
+development team. If you want to contribute patches, these will be your
+primary contact points:
+
+IRC:
+
+ Join #catalyst-dev on irc.perl.org.
+
+Mailing Lists:
+
+
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
+
=head1 AUTHOR
Christian Hansen, C<chansen@cpan.org>
--
1.7.2.3.msysgit.0
From df2ca021b7a2030cbd2171fbe6b439e9d2b1e3b6 Mon Sep 17 00:00:00 2001
From: Christian Walde <walde.christian@googlemail.com>
Date: Thu, 7 Oct 2010 20:35:15 +0200
Subject: [PATCH 2/4] made multipart suffix extraction more robust by only looking at the basename, which makes it possible for the test to be more specific and work on windows
---
lib/HTTP/Body/MultiPart.pm | 4 +++-
t/08multipart-suffix.t | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/HTTP/Body/MultiPart.pm b/lib/HTTP/Body/MultiPart.pm
index 5b0adff..0296171 100644
--- a/lib/HTTP/Body/MultiPart.pm
+++ b/lib/HTTP/Body/MultiPart.pm
@@ -6,6 +6,7 @@ use bytes;
use IO::File;
use File::Temp 0.14;
+use File::Spec;
=head1 NAME
@@ -270,7 +271,8 @@ sub handler {
$part->{filename} = $filename;
if ( $filename ne "" ) {
- my $suffix = $filename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{};
+ my $basename = (File::Spec->splitpath($filename))[2];
+ my $suffix = $basename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{};
my $fh = File::Temp->new( UNLINK => 0, DIR => $self->tmpdir, SUFFIX => $suffix );
diff --git a/t/08multipart-suffix.t b/t/08multipart-suffix.t
index 367db05..20ae483 100644
--- a/t/08multipart-suffix.t
+++ b/t/08multipart-suffix.t
@@ -54,8 +54,8 @@ my $path = catdir( getcwd(), 't', 'data', 'multipart' );
'tempname preserves .txt suffix when dir name has .'
);
- unlike(
- $uploads->{upload2}{tempname}, qr/\\/,
+ like(
+ $uploads->{upload2}{tempname}, qr/[\\\/]\w+.txt$/,
'tempname only gets extension from filename, not from a directory name'
);
}
--
1.7.2.3.msysgit.0