Skip to content

Commit bef93cb

Browse files
committed
Manually convert true/false to "true"/"false" before http_build_query()
`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.
1 parent 4adbe94 commit bef93cb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Elasticsearch/Connections/Connection.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ private function wrapHandler(callable $handler, LoggerInterface $logger, LoggerI
294294
private function getURI($uri, $params)
295295
{
296296
if (isset($params) === true && !empty($params)) {
297+
array_walk($params, function (&$value, &$key) {
298+
if ($value === true) {
299+
$value = 'true';
300+
} else if ($value === false) {
301+
$value = 'false';
302+
}
303+
});
304+
297305
$uri .= '?' . http_build_query($params);
298306
}
299307

0 commit comments

Comments
 (0)