kane++'s fix for passing @INC down to the restarter child
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 8c0fc7b..cb3e86d 100644 (file)
@@ -61,7 +61,7 @@ __PACKAGE__->response_class('Catalyst::Response');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.7000';
+our $VERSION = '5.7001';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -889,6 +889,7 @@ sub uri_for {
                          : [] );
         $path = $c->dispatcher->uri_for_action($path, $captures);
         return undef unless defined($path);
+        $path = '/' if $path eq '';
     }
 
     # massage namespace, empty if absolute path
@@ -902,11 +903,10 @@ sub uri_for {
       ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} );
 
     for my $value ( values %$params ) {
-        my $isa_ref = ref $value;
-        if( $isa_ref and $isa_ref ne 'ARRAY' ) {
-            croak( "Non-array reference ($isa_ref) passed to uri_for()" );
+        for ( ref $value eq 'ARRAY' ? @$value : $value ) {
+            $_ = "$_";
+            utf8::encode( $_ );
         }
-        utf8::encode( $_ ) for grep { defined } $isa_ref ? @$value : $value;
     };
     
     # join args with '/', or a blank string
@@ -1148,7 +1148,7 @@ sub execute {
     my $last = pop( @{ $c->stack } );
 
     if ( my $error = $@ ) {
-        if ( $error eq $DETACH ) { die $DETACH if $c->depth > 1 }
+        if ( !ref($error) and $error eq $DETACH ) { die $DETACH if $c->depth > 1 }
         else {
             unless ( ref $error ) {
                 no warnings 'uninitialized';