Commit 3ac9388d authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Always decode data in %ARGS as UTF-8 in DecodeArgs

There is no need to check is_utf8 on the arguments passed to DecodeArgs,
as it is the first and only line of decoding of arguments over HTTP.
parent f67c72a2
......@@ -1219,15 +1219,11 @@ sub DecodeARGS {
# passed just one, a scalar whatever they are, mark them as utf8
my $type = ref($_);
( !$type )
? Encode::is_utf8($_)
? $_
: Encode::decode( 'UTF-8' => $_, Encode::FB_PERLQQ )
? Encode::decode( 'UTF-8', $_, Encode::FB_PERLQQ )
: ( $type eq 'ARRAY' )
? [ map { ( ref($_) or Encode::is_utf8($_) ) ? $_ : Encode::decode( 'UTF-8' => $_, Encode::FB_PERLQQ ) }
@$_ ]
? [ map { ref($_) ? $_ : Encode::decode( 'UTF-8', $_, Encode::FB_PERLQQ ) } @$_ ]
: ( $type eq 'HASH' )
? { map { ( ref($_) or Encode::is_utf8($_) ) ? $_ : Encode::decode( 'UTF-8' => $_, Encode::FB_PERLQQ ) }
%$_ }
? { map { ref($_) ? $_ : Encode::decode( 'UTF-8', $_, Encode::FB_PERLQQ ) } %$_ }
: $_
} %$ARGS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment