X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=9183864fe422500e4214e96695e67bbce3fb9576;hp=01d0d5f2861fe8522f559fd965bbad458c3b09d1;hb=059c085bfcead450e70ace9ef193aa99ac2ab37d;hpb=221cd1f58a0cdea3d91c874f1940a1c06df3fb76 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 01d0d5f..9183864 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.7012'; +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; @@ -1335,11 +1338,6 @@ sub finalize { $c->log->error($error); } - # utf8-encode the body (convert perl chars to utf8 on the wire) - if ( $c->response->{body} && utf8::is_utf8($c->response->{body}) ){ - utf8::encode( $c->response->{body} ); - } - # Allow engine to handle finalize flow (for POE) if ( $c->engine->can('finalize') ) { $c->engine->finalize($c); @@ -1574,10 +1572,8 @@ sub prepare { } # For on-demand data - $c->request->{_context} = $c; - $c->response->{_context} = $c; - weaken( $c->request->{_context} ); - weaken( $c->response->{_context} ); + $c->request->_context($c); + $c->response->_context($c); # Allow engine to direct the prepare flow (for POE) if ( $c->engine->can('prepare') ) {