Fix locating t/lib
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index c53bc12..63b236d 100644 (file)
@@ -157,6 +157,7 @@ EOF
 (no) Vennligst prov igjen senere
 (dk) Venligst prov igen senere
 (pl) Prosze sprobowac pozniej
+(pt) Por favor volte mais tarde
 </pre>
 
         $name = '';
@@ -314,7 +315,7 @@ sub prepare_body {
         unless ( $c->request->{_body} ) {
             my $type = $c->request->header('Content-Type');
             $c->request->{_body} = HTTP::Body->new( $type, $length );
-            $c->request->{_body}->{tmpdir} = $c->config->{uploadtmp}
+            $c->request->{_body}->tmpdir( $c->config->{uploadtmp} )
               if exists $c->config->{uploadtmp};
         }
         
@@ -452,13 +453,13 @@ sub prepare_query_parameters {
     # replace semi-colons
     $query_string =~ s/;/&/g;
     
-    my @params = split /&/, $query_string;
+    my @params = grep { length $_ } split /&/, $query_string;
 
     for my $item ( @params ) {
         
         my ($param, $value) 
             = map { $self->unescape_uri($_) }
-              split( /=/, $item );
+              split( /=/, $item, 2 );
           
         $param = $self->unescape_uri($item) unless defined $param;
         
@@ -658,10 +659,9 @@ as Apache may implement this using Apache's C-based modules, for example.
 
 sub unescape_uri {
     my ( $self, $str ) = @_;
-    
-    $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
-    $str =~ s/\+/ /g;
-    
+
+    $str =~ s/(?:%([0-9A-Fa-f]{2})|\+)/defined $1 ? chr(hex($1)) : ' '/eg;
+
     return $str;
 }
 
@@ -671,9 +671,7 @@ sub unescape_uri {
 
 =head1 AUTHORS
 
-Sebastian Riedel, <sri@cpan.org>
-
-Andy Grundman, <andy@hybridized.org>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT