mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Fix type of select_db()
This commit is contained in:
@@ -53,7 +53,7 @@ if (isset($_GET["mssql"])) {
|
||||
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
return $this->query(use_sql($database));
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
} else {
|
||||
abstract class MssqlDb extends PdoDb {
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
// database selection is separated from the connection so dbname in DSN can't be used
|
||||
return $this->query(use_sql($database));
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
return "'" . mysql_real_escape_string($string, $this->link) . "'";
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
return mysql_select_db($database, $this->link);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
return $this->query("SET NAMES $charset"); // charset in DSN is ignored before PHP 5.3.6
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
// database selection is separated from the connection so dbname in DSN can't be used
|
||||
return $this->query("USE " . idf_escape($database));
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ if (isset($_GET["oracle"])) {
|
||||
return "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
$this->_current_db = $database;
|
||||
return true;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ if (isset($_GET["oracle"])) {
|
||||
return $this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
$this->_current_db = $database;
|
||||
return true;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ if (isset($_GET["pgsql"])) {
|
||||
return ($field["type"] == "bytea" && $val !== null ? pg_unescape_bytea($val) : $val);
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
if ($database == adminer()->database()) {
|
||||
return $this->database;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ if (isset($_GET["pgsql"])) {
|
||||
return $this->dsn($dsn, $username, $password);
|
||||
}
|
||||
|
||||
function select_db(string $database): bool {
|
||||
function select_db(string $database) {
|
||||
return (adminer()->database() == $database);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user