X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=cb3e86d14d2c9d852ce4987070df2ed1c751265b;hp=0698ade27f63dd67e11398dc08db40d2cea5d4cb;hb=e37e397712a443ae02f23cee03f6ba4ddda5bf64;hpb=91d08727e09f9cf96248fdcf3ed355fcf07b6ff0 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 0698ade..cb3e86d 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -61,7 +61,7 @@ __PACKAGE__->response_class('Catalyst::Response'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.70_03'; +our $VERSION = '5.7001'; sub import { my ( $class, @arguments ) = @_; @@ -869,7 +869,7 @@ in standard fashion. Instead of C<$path>, you can also optionally pass a C<$action> object which will be resolved to a path using -C<< $c->dispatcher->uri_for_action .>; if the first element of +C<< $c->dispatcher->uri_for_action >>; if the first element of C<@args> is an arrayref it is treated as a list of captures to be passed to C. @@ -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'; @@ -1795,7 +1795,7 @@ sub setup_components { ); for my $component ( sort { length $a <=> length $b } $locator->plugins ) { - Catalyst::Utils::ensure_class_loaded( $component ); + Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } ); my $module = $class->setup_component( $component ); my %modules = (