X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=eaf50796505107af939e11f6a1533b6f1154b1ea;hp=7c20e93e372885c29b231e716ea3ad742e332be7;hb=4a62800defdaa16ec1a5bef88f3e639c983b6f1d;hpb=b9d96e27325fd2b5bc7ff2bd28e5c96675b42c7f diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 7c20e93..eaf5079 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2579,26 +2579,6 @@ Prepares uploads. sub prepare_uploads { my $c = shift; $c->engine->prepare_uploads( $c, @_ ); - - my $enc = $c->encoding; - return unless $enc; - - ## Only trying to decode the filenames. - for my $value ( values %{ $c->request->uploads } ) { - # skip if it fails for uploads, as we don't usually want uploads touched - # in any way - for my $inner_value ( ref($value) eq 'ARRAY' ? @{$value} : $value ) { - $inner_value->{filename} = try { - $enc->decode( $inner_value->{filename}, $c->_encode_check ) - } catch { - $c->handle_unicode_encoding_exception({ - param_value => $inner_value->{filename}, - error_msg => $_, - encoding_step => 'uploads', - }); - }; - } - } } =head2 $c->prepare_write @@ -3124,7 +3104,10 @@ sub _handle_unicode_decoding { foreach (keys %$value) { my $encoded_key = $self->_handle_param_unicode_decoding($_); $value->{$encoded_key} = $self->_handle_unicode_decoding($value->{$_}); - delete $value->{$_}; + + # If the key was encoded we now have two (the original and current so + # delete the original. + delete $value->{$_} if $_ ne $encoded_key; } return $value; }