Elasticsearch, ClickHouse: Do not print response if HTTP code is not 200

Thanks to Adam Crosser and Brian Sizemore
This commit is contained in:
Jakub Vrana 2021-02-05 16:16:23 +01:00
parent 1e1c46ac72
commit ccd2374b0b
3 changed files with 3 additions and 2 deletions

View file

@ -22,7 +22,7 @@ if (isset($_GET["clickhouse"])) {
return $file;
}
if (!preg_match('~^HTTP/[0-9.]+ 2~i', $http_response_header[0])) {
$this->error = $file;
$this->error = lang('Invalid credentials.') . " $http_response_header[0]";
return false;
}
$return = json_decode($file, true);

View file

@ -28,7 +28,7 @@ if (isset($_GET["elastic"])) {
return $file;
}
if (!preg_match('~^HTTP/[0-9.]+ 2~i', $http_response_header[0])) {
$this->error = $file;
$this->error = lang('Invalid credentials.') . " $http_response_header[0]";
return false;
}
$return = json_decode($file, true);

View file

@ -1,4 +1,5 @@
Adminer 4.7.9-dev:
Elasticsearch, ClickHouse: Do not print response if HTTP code is not 200
Re-enable PHP warnings (regression from 4.7.8)
Adminer 4.7.8 (released 2020-12-06):