X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=ea96adc2ee0842ead33d538d9e35a24bfd90e4d1;hp=2d40ae855f89a9f172e9f0b75239b86d09f46036;hb=d86c0bd4acc04426e8fb3014772b9d469545cbb7;hpb=bde75a9e4dbbf97e78d29125e6f3c81207a28fbf diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 2d40ae8..ea96adc 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -51,6 +51,7 @@ use Catalyst::Middleware::Stash; use Plack::Util; use Class::Load 'load_class'; use Encode 2.21 'decode_utf8', 'encode_utf8'; +use Scalar::Util; BEGIN { require 5.008003; } @@ -204,7 +205,7 @@ sub composed_stats_class { __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90111'; +our $VERSION = '5.90113'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases sub import { @@ -2490,6 +2491,8 @@ sub prepare { }; $c->log_request; + $c->{stash} = $c->stash; + Scalar::Util::weaken($c->{stash}); return $c; } @@ -3654,6 +3657,9 @@ sub _handle_param_unicode_decoding { return $value if blessed($value); #don't decode when the value is an object. my $enc = $self->encoding; + + return $value unless $enc; # don't decode if no encoding is specified + $check ||= $self->_encode_check; return try { $enc->decode( $value, $check);