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'
Browse files Browse the repository at this point in the history
  • Loading branch information
breart committed Nov 29, 2019
2 parents 63a4bce + 9dc3d9c commit bd9477f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2019-11-29

### Fixed
- Fix query string hash with false parameters (pull request #11, @jvanraaij)

## [1.3.0] - 2019-10-27

### Added
Expand Down Expand Up @@ -66,7 +71,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Package keywords at composer.json

[Unreleased]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.3.0...HEAD
[Unreleased]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.3.1...HEAD
[1.3.1]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.2.4...v1.3.0
[1.2.4]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.2.3...v1.2.4
[1.2.3]: https://github.com/brezzhnev/atlassian-connect-core/compare/v1.2.2...v1.2.3
Expand Down
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 bd9477f

Please sign in to comment.