X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=933c071b69b93aa90c91de32f83cedf9c0fd362e;hb=b2d40c03a584dac092c64ebc632397264fc57dc7;hp=904693bb829a541514169c21cfb37ba2832aa28c;hpb=f991f6a0dd3b2fc63223bf206c402fce8213807f;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 904693b..933c071 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -43,7 +43,7 @@ our $DETACH = "catalyst_detach\n"; require Module::Pluggable::Fast; # Helper script generation -our $CATALYST_SCRIPT_GEN = 19; +our $CATALYST_SCRIPT_GEN = 20; __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class @@ -54,7 +54,7 @@ __PACKAGE__->engine_class('Catalyst::Engine::CGI'); __PACKAGE__->request_class('Catalyst::Request'); __PACKAGE__->response_class('Catalyst::Response'); -our $VERSION = '5.57'; +our $VERSION = '5.58'; sub import { my ( $class, @arguments ) = @_; @@ -674,8 +674,11 @@ sub uri_for { # join args with '/', or a blank string my $args = ( scalar @args ? '/' . join( '/', @args ) : '' ); - return URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), - $base )->canonical; + $args =~ s/^\/// unless $path; + my $res = + URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base ) + ->canonical; + $res; } =head2 $c->welcome_message