$database,
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
(!is_numeric($port) ? $port : $socket),
- ($ssl ? (empty($ssl['cert']) ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
+ ($ssl ? ($ssl['verify'] !== false ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
);
$this->options(MYSQLI_OPT_LOCAL_INFILE, false);
return $return;
$options = array(PDO::MYSQL_ATTR_LOCAL_INFILE => false);
$ssl = $adminer->connectSsl();
if ($ssl) {
- if (!empty($ssl['key'])) {
+ if ($ssl['key']) {
$options[PDO::MYSQL_ATTR_SSL_KEY] = $ssl['key'];
}
- if (!empty($ssl['cert'])) {
+ if ($ssl['cert']) {
$options[PDO::MYSQL_ATTR_SSL_CERT] = $ssl['cert'];
}
- if (!empty($ssl['ca'])) {
+ if ($ssl['ca']) {
$options[PDO::MYSQL_ATTR_SSL_CA] = $ssl['ca'];
}
- if (!empty($ssl['verify'])) {
+ if (isset($ssl['verify'])) {
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $ssl['verify'];
}
}
<?php
-/** Connect to MySQL or PostgreSQL using SSL
+/** Connect to MySQL, PostgreSQL or MS SQL using SSL
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0