X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FChained.pm;h=349574975e230221c0227604abcef28461dd5536;hb=f4fba3d7cf527e80b293f46c1830f77e557bf6d2;hp=8549f062b8d1ad032f4ce35eccdfff14c6171256;hpb=536bee890cf24e0e4bcda7562e7b70cc03ca0620;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 8549f06..3495749 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -233,12 +233,14 @@ sub recurse_match { local $c->req->{arguments} = [ @{$c->req->args}, @parts ]; next TRY_ACTION unless $action->match($c); } - my $args_attr = $action->attributes->{Args}->[0]; + + # Default args is blank, not 0, since Args() + my $args_attr = $action->attributes->{Args}->[0] || ''; # No best action currently # OR This one matches with fewer parts left than the current best action, # And therefore is a better match - # OR No parts and this expects 0 + # OR No parts and this expects 0 # The current best action might also be Args(0), # but we couldn't chose between then anyway so we'll take the last seen @@ -353,9 +355,7 @@ sub uri_for_action { if (my $cap = $curr->attributes->{CaptureArgs}) { return undef unless @captures >= $cap->[0]; # not enough captures if ($cap->[0]) { - unshift(@parts, - map { s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go; $_; } - splice(@captures, -$cap->[0])); + unshift(@parts, splice(@captures, -$cap->[0])); } } if (my $pp = $curr->attributes->{PartPath}) { @@ -376,7 +376,7 @@ sub uri_for_action { =head2 $c->expand_action($action) -Return a list of actions that represents a chained action. See +Return a list of actions that represents a chained action. See L for more info. You probably want to use the expand_action it provides rather than this directly. @@ -559,7 +559,7 @@ this debugging output: '-----------------------+------------------------------' ... -Here's a more detailed specification of the attributes belonging to +Here's a more detailed specification of the attributes belonging to C<:Chained>: =head2 Attributes