X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FController.pm;fp=lib%2FCatalyst%2FController.pm;h=73c647f537fa7d080b3d807db2dbe60bd2755d80;hp=afa3e3f78b0cfb3b24d59600d370d1bc9f5e14ca;hb=8da84fe819bc01669deed2ae45d15fbb7d534dab;hpb=976220fb6507cadfbeebdd98e30861e2636e9b14 diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index afa3e3f..73c647f 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -458,9 +458,11 @@ sub _parse_Absolute_attr { shift->_parse_Global_attr(@_); } sub _parse_Local_attr { my ( $self, $c, $name, $value ) = @_; # _parse_attr will call _parse_Path_attr for us + $name = join( '/', $self->path_prefix($c), $name); + $name =~ s!^/!!; return ( 'Chained' => '/', - 'PathPart' => join( '/', $self->path_prefix($c), $name) + 'PathPart' => $name ); } @@ -469,24 +471,19 @@ sub _parse_Relative_attr { shift->_parse_Local_attr(@_); } sub _parse_Path_attr { my ( $self, $c, $name, $value ) = @_; $value = '' if !defined $value; - if ( $value =~ s!^/!! ) { - return ( - 'Chained' => '/', - 'PathPart' => $value - ); + if ( $value =~ m!^/! ) { } elsif ( length $value ) { - return ( - 'Chained' => '/', - 'PathPart' => join( '/', $self->path_prefix($c), $value ) - ); + $value = join( '/', $self->path_prefix($c), $value ) } else { - return ( - 'Chained' => '/', - 'PathPart' => $self->path_prefix($c) - ); + $value = $self->path_prefix($c) } + $value =~ s!^/!!; + return ( + 'Chained' => '/', + 'PathPart' => $value + ); } sub _parse_Chained_attr {