Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
xsawyerx committed Apr 5, 2012
2 parents 965c147 + 47d2491 commit 3790b0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ skip = ^t::lib::Functions$
[ReadmeFromPod]
[CheckChangeLog]
[PkgVersion]
[Repository]
4 changes: 3 additions & 1 deletion lib/MetaCPAN/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ sub _build_extra_params {
or croak 'Incorrect number of params, must be key/value';

my %extra = @_;
my $extra = join '&', map { "$_=" . uri_escape($extra{$_}) } keys %extra;
my $extra = join '&', map {
"$_=" . uri_escape( $extra{$_} )
} sort keys %extra;

return $extra;
}
Expand Down
4 changes: 2 additions & 2 deletions t/_build_extra_params.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ is(
# regular
is(
$mcpan->_build_extra_params( param1 => 'one', param2 => 'two' ),
'param2=two&param1=one',
'param1=one&param2=two',
'Basic params',
);

# throw some symbols in there
is(
$mcpan->_build_extra_params( param1 => 'one', param2 => 'two space' ),
'param2=two%20space&param1=one',
'param1=one&param2=two%20space',
'Escaping HTML in params',
);

0 comments on commit 3790b0f

Please sign in to comment.