Skip to content

Commit a5182bd

Browse files
committed
fix and close gentlero#12
- Filters from group/get accepted an array with duplicate keys. - Parameters sent with GET request must not be encoded (changed again ?) -> Wrapped http_build_query in urldecode
1 parent f460ec4 commit a5182bd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Bitbucket/API/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected function doRequest($method, $endpoint, array $params, array $headers)
187187
$this->authorize($request);
188188

189189
if (strtoupper($method) == 'GET') {
190-
$request->fromUrl(self::API_URL.'/'.urlencode($endpoint).'?'. http_build_query($params));
190+
$request->fromUrl(self::API_URL.'/'.urlencode($endpoint).'?'. urldecode(http_build_query($params)));
191191
} else {
192192
$request->fromUrl(self::API_URL.'/'.urlencode($endpoint));
193193
$request->setContent(http_build_query($params));

lib/Bitbucket/API/Groups.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class Groups extends Api
2929
*
3030
* <example>
3131
* $filters = array(
32-
* 'group' => 'account_name/group_slug',
33-
* 'group' => 'other_account/group_slug'
32+
* 'group' => array('account_name/group_slug', 'other_account/group_slug')
3433
* );
3534
* </example>
3635
*
@@ -46,6 +45,10 @@ public function get($account, array $filters = array())
4645

4746
if (!empty($filters)) {
4847
$endpoint = 'groups';
48+
49+
if (isset($filters['group']) && is_array($filters['group'])) {
50+
$filters['group'] = implode('&group=', $filters['group']);
51+
}
4952
}
5053

5154
return $this->requestGet($endpoint, $filters);

0 commit comments

Comments
 (0)