Skip to content

Commit

Permalink
Compatibility with Elasticsearch 7.14
Browse files Browse the repository at this point in the history
- Removed empty body from requests.
  • Loading branch information
peterpp committed Sep 18, 2021
1 parent c2214eb commit 920a11c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adminer/drivers/elastic.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Min_DB {
* @param string
* @return mixed
*/
function rootQuery($path, $content = array(), $method = 'GET') {
function rootQuery($path, $content = null, $method = 'GET') {
@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,
Expand Down Expand Up @@ -59,7 +59,7 @@ function rootQuery($path, $content = array(), $method = 'GET') {
* @param string
* @return mixed
*/
function query($path, $content = array(), $method = 'GET') {
function query($path, $content = null, $method = 'GET') {
// Support for global search through all tables
if ($path[0] == "S" && preg_match('/SELECT 1 FROM ([^ ]+) WHERE (.+) LIMIT ([0-9]+)/', $path, $matches)) {
global $driver;
Expand Down Expand Up @@ -467,7 +467,7 @@ function create_database($db) {
*/
function drop_databases($databases) {
global $connection;
return $connection->rootQuery(urlencode(implode(',', $databases)), array(), 'DELETE');
return $connection->rootQuery(urlencode(implode(',', $databases)), null, 'DELETE');
}

/** Alter type
Expand Down Expand Up @@ -498,7 +498,7 @@ function drop_tables($tables) {
global $connection;
$return = true;
foreach ($tables as $table) { //! convert to bulk api
$return = $return && $connection->query(urlencode($table), array(), 'DELETE');
$return = $return && $connection->query(urlencode($table), null, 'DELETE');
}
return $return;
}
Expand Down

0 comments on commit 920a11c

Please sign in to comment.