Pass credentials to connect()

This commit is contained in:
Jakub Vrana
2025-03-07 12:03:29 +01:00
parent 95e6a65999
commit 9918f4155e
15 changed files with 22 additions and 36 deletions

View File

@@ -286,10 +286,10 @@ if (isset($_GET["elastic"])) {
}
}
function connect() {
function connect($credentials) {
$connection = new Db;
list($server, $username, $password) = adminer()->credentials();
list($server, $username, $password) = $credentials;
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $server)) {
return lang('Invalid server.');
}