From: John Napiorkowski Date: Tue, 23 Sep 2014 17:06:15 +0000 (-0500) Subject: do not decode values that are undefined X-Git-Tag: 5.90076~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=7d670fb446850f89dc7ee626cda155e72320732e do not decode values that are undefined --- diff --git a/Changes b/Changes index e143aea..5c246ec 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,7 @@ You shouldn't do this, but I guess I shouldn't have busted it either :) - Allow the term_width to be regenerated (see Catalyst::Utils::term_width, Frew Schmidt) + - More aggressive skipping of value decoding if the value is undefined. 5.90072 - 2014-09-15 - In the case where you call $c->req->param(undef), warn with a more useful diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 958e005..d3880e6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3071,6 +3071,7 @@ sub _handle_unicode_decoding { return unless defined $value; + ## I think this mess is to support the old nested if ( ref $value eq 'ARRAY' ) { foreach ( @$value ) { $_ = $self->_handle_unicode_decoding($_); @@ -3090,6 +3091,8 @@ sub _handle_unicode_decoding { sub _handle_param_unicode_decoding { my ( $self, $value ) = @_; + return unless defined $value; # not in love with just ignoring undefs - jnap + my $enc = $self->encoding; return try { Encode::is_utf8( $value ) ?