diff --git a/adminer/drivers/elastic.inc.php b/adminer/drivers/elastic.inc.php index a0cc4c18..6e1df1ef 100644 --- a/adminer/drivers/elastic.inc.php +++ b/adminer/drivers/elastic.inc.php @@ -18,9 +18,11 @@ if (isset($_GET["elastic"])) { @ini_set('track_errors', 1); // @ - may be disabled $file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array( 'method' => $method, - 'content' => $content === null ? $content : json_encode($content), - 'header' => 'Content-Type: application/json', - 'ignore_errors' => 1, // available since PHP 5.2.10 + 'content' => $content !== null ? json_encode($content) : null, + 'header' => $content !== null ? 'Content-Type: application/json' : [], + 'ignore_errors' => 1, + 'follow_location' => 0, + 'max_redirects' => 0, )))); if (!$file) { $this->error = error_get_last()['message']; diff --git a/plugins/drivers/clickhouse.php b/plugins/drivers/clickhouse.php index e489038f..1d188219 100644 --- a/plugins/drivers/clickhouse.php +++ b/plugins/drivers/clickhouse.php @@ -14,7 +14,9 @@ if (isset($_GET["clickhouse"])) { 'method' => 'POST', 'content' => $this->isQuerySelectLike($query) ? "$query FORMAT JSONCompact" : $query, 'header' => 'Content-type: application/x-www-form-urlencoded', - 'ignore_errors' => 1, // available since PHP 5.2.10 + 'ignore_errors' => 1, + 'follow_location' => 0, + 'max_redirects' => 0, )))); if ($file === false) { diff --git a/plugins/drivers/simpledb.php b/plugins/drivers/simpledb.php index 9fafe884..30577d88 100644 --- a/plugins/drivers/simpledb.php +++ b/plugins/drivers/simpledb.php @@ -425,7 +425,9 @@ if (isset($_GET["simpledb"])) { $file = @file_get_contents((preg_match('~^https?://~', $host) ? $host : "http://$host"), false, stream_context_create(array('http' => array( 'method' => 'POST', // may not fit in URL with GET 'content' => $query, - 'ignore_errors' => 1, // available since PHP 5.2.10 + 'ignore_errors' => 1, + 'follow_location' => 0, + 'max_redirects' => 0, )))); if (!$file) { $connection->error = $php_errormsg;