Forbid protocol and port number in server for Elastisearch driver

This commit is contained in:
Lionel Laffineur 2023-12-01 22:57:05 +01:00
parent 133c53f24a
commit b3ebf738aa

View file

@ -227,6 +227,9 @@ if (isset($_GET["elastic"])) {
global $adminer;
$connection = new Min_DB;
list($server, $username, $password) = $adminer->credentials();
if (strpos($server, '/') !== false || strpos($server, ':') !== false) {
return lang('Only hostname or IP address');
}
if ($password != "" && $connection->connect($server, $username, "")) {
return lang('Database does not support password.');
}