From b2759df1f949f24e69737e7d1151551afc8dd37e Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Thu, 25 Jan 2024 13:43:18 +0100 Subject: [PATCH] Disable redirections in HTTP based drivers --- adminer/drivers/elastic.inc.php | 2 ++ plugins/drivers/clickhouse.php | 2 ++ plugins/drivers/simpledb.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/adminer/drivers/elastic.inc.php b/adminer/drivers/elastic.inc.php index 799f6d0b..fe33c315 100644 --- a/adminer/drivers/elastic.inc.php +++ b/adminer/drivers/elastic.inc.php @@ -21,6 +21,8 @@ if (isset($_GET["elastic"])) { 'content' => $content === null ? $content : json_encode($content), 'header' => 'Content-Type: application/json', 'ignore_errors' => 1, // available since PHP 5.2.10 + 'follow_location' => 0, + 'max_redirects' => 0, )))); if (!$file) { $this->error = $php_errormsg; diff --git a/plugins/drivers/clickhouse.php b/plugins/drivers/clickhouse.php index 60bb0b45..86f3464d 100644 --- a/plugins/drivers/clickhouse.php +++ b/plugins/drivers/clickhouse.php @@ -15,6 +15,8 @@ if (isset($_GET["clickhouse"])) { '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 + 'follow_location' => 0, + 'max_redirects' => 0, )))); if ($file === false) { diff --git a/plugins/drivers/simpledb.php b/plugins/drivers/simpledb.php index 9fafe884..226625f1 100644 --- a/plugins/drivers/simpledb.php +++ b/plugins/drivers/simpledb.php @@ -426,6 +426,8 @@ if (isset($_GET["simpledb"])) { 'method' => 'POST', // may not fit in URL with GET 'content' => $query, 'ignore_errors' => 1, // available since PHP 5.2.10 + 'follow_location' => 0, + 'max_redirects' => 0, )))); if (!$file) { $connection->error = $php_errormsg;