1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Elasticsearch: Support HTTPS by inputting https://server (bug #446)

This commit is contained in:
Jakub Vrana
2017-02-20 18:06:14 +01:00
parent fa09eba15e
commit 9df33e82e6
2 changed files with 3 additions and 1 deletions

View File

@@ -59,7 +59,8 @@ if (isset($_GET["elastic"])) {
}
function connect($server, $username, $password) {
$this->_url = "http://$username:$password@$server/";
preg_match('~^(https?://)?(.+)~', $server, $match);
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]/";
$return = $this->query('');
if ($return) {
$this->server_info = $return['version']['number'];