Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/1.3.1' of github.com:brezzhnev/atlassian-connect…
Browse files Browse the repository at this point in the history
…-core into hotfix/1.3.1
  • Loading branch information
breart committed Nov 29, 2019
2 parents f30af7c + b22bb85 commit 9dc3d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Http/Auth/QSH.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,9 @@ protected function buildQuery(array $params): string
$pieces = [];

foreach ($this->encodeQueryParams($params) as $param => $values) {
$value = implode(',', $values);

$pieces[] = implode('=', !$value
? [$param]
: [$param, $value]
);
$pieces[] = $values
? implode('=', [$param, implode(',', $values)])
: $param;
}

return implode('&', array_filter($pieces));
Expand Down
4 changes: 4 additions & 0 deletions tests/Auth/QSHTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function testCanonicalQuery()
$this->assertCanonicalQuery('a=x1&a=x10&b=y1&b=y10', 'a=x1,x10&b=y1,y10');
$this->assertCanonicalQuery('a=another+one&a=one+string&b=and+yet+more&b=more+here', 'a=another%20one,one%20string&b=and%20yet%20more,more%20here');
$this->assertCanonicalQuery('a=1%2C2%2C3&a=4%2C5%2C6&b=a%2Cb%2Cc&b=d%2Ce%2Cf', 'a=1%2C2%2C3,4%2C5%2C6&b=a%2Cb%2Cc,d%2Ce%2Cf');

// Parameter values that might evaluate weirdly in PHP
$this->assertCanonicalQuery('empty=', 'empty=');
$this->assertCanonicalQuery('since=0', 'since=0');
}

/**
Expand Down

0 comments on commit 9dc3d9c

Please sign in to comment.