X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=b27f09018041c74f9d3b67276f2d8982af622573;hb=25f55123b7c0b520eb166890bf47f1f3217200af;hp=0e0bf01a18e7a08e4a8e63fdc4403a0d8bb27a52;hpb=74efc1444f7b8653bb6d7aa493974934bc9787e1;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 0e0bf01..b27f090 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -65,7 +65,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.7011'; +our $VERSION = '5.7013'; sub import { my ( $class, @arguments ) = @_; @@ -920,6 +920,9 @@ If the last argument to C is a hash reference, it is assumed to contain GET parameter key/value pairs, which will be appended to the URI in standard fashion. +Note that uri_for is destructive to the passed hashref. Subsequent calls +with the same hashref may have unintended results. + 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 @@ -978,7 +981,7 @@ sub uri_for { $val = '' unless defined $val; (map { $_ = "$_"; - utf8::encode( $_ ); + utf8::encode( $_ ) if utf8::is_utf8($_); # using the URI::Escape pattern here so utf8 chars survive s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go; s/ /+/g; @@ -1273,22 +1276,28 @@ sub _stats_start_execute { # forward, locate the caller if ( my $parent = $c->stack->[-1] ) { - $c->stats->profile(begin => $action, - parent => "$parent" . $c->counter->{"$parent"}, - uid => $uid); + $c->stats->profile( + begin => $action, + parent => "$parent" . $c->counter->{"$parent"}, + uid => $uid, + ); } else { # forward with no caller may come from a plugin - $c->stats->profile(begin => $action, - uid => $uid); + $c->stats->profile( + begin => $action, + uid => $uid, + ); } } else { # root-level call - $c->stats->profile(begin => $action, - uid => $uid); + $c->stats->profile( + begin => $action, + uid => $uid, + ); } return $action; @@ -1296,7 +1305,7 @@ sub _stats_start_execute { sub _stats_finish_execute { my ( $c, $info ) = @_; - $c->stats->profile(end => $info); + $c->stats->profile( end => $info ); } =head2 $c->_localize_fields( sub { }, \%keys ); @@ -1426,6 +1435,7 @@ sub finalize_headers { } } else { + # everything should be bytes at this point, but just in case $c->response->content_length( bytes::length( $c->response->body ) ); } }