Skip to content

Commit

Permalink
Manually convert true/false to "true"/"false" before http_build_query()
Browse files Browse the repository at this point in the history
`http_build_query()` converts true/false to 0/1. Was not a problem previously, as `refresh`
didn't accept any actual values.  But now that it accepts `wait_for`, etc the conversion is bad.

We need to manually convert true/false to "true"/"false" strings now.
  • Loading branch information
polyfractal committed Jul 6, 2016
1 parent 4adbe94 commit bef93cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Elasticsearch/Connections/Connection.php
Expand Up @@ -294,6 +294,14 @@ private function wrapHandler(callable $handler, LoggerInterface $logger, LoggerI
private function getURI($uri, $params)
{
if (isset($params) === true && !empty($params)) {
array_walk($params, function (&$value, &$key) {
if ($value === true) {
$value = 'true';
} else if ($value === false) {
$value = 'false';
}
});

$uri .= '?' . http_build_query($params);
}

Expand Down

0 comments on commit bef93cb

Please sign in to comment.