Add ability to pass sslmode for postgres
This commit is contained in:
parent
eb7ee8bb18
commit
ae1ecae3b4
|
@ -20,6 +20,10 @@ if (isset($_GET["pgsql"])) {
|
|||
$db = $adminer->database();
|
||||
set_error_handler(array($this, '_error'));
|
||||
$this->_string = "host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'";
|
||||
$ssl = $adminer->connectSsl();
|
||||
if ($ssl) {
|
||||
$this->_string.= " sslmode='" . ($ssl['sslmode'] ?: 'require') . "'";
|
||||
}
|
||||
$this->_link = @pg_connect("$this->_string dbname='" . ($db != "" ? addcslashes($db, "'\\") : "postgres") . "'", PGSQL_CONNECT_FORCE_NEW);
|
||||
if (!$this->_link && $db != "") {
|
||||
// try to connect directly with database for performance
|
||||
|
|
Loading…
Reference in a new issue