Avoid fatal in PostgreSQL without implemented database()
https://sourceforge.net/p/adminer/discussion/1095138/thread/5e29e380/
This commit is contained in:
parent
aae2289095
commit
e680d22023
|
@ -19,11 +19,13 @@ class Adminer {
|
|||
|
||||
function database() {
|
||||
global $connection;
|
||||
$databases = $this->databases(false);
|
||||
return (!$databases
|
||||
? $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)") // username without the database list
|
||||
: $databases[(information_schema($databases[0]) ? 1 : 0)] // first available database
|
||||
);
|
||||
if ($connection) {
|
||||
$databases = $this->databases(false);
|
||||
return (!$databases
|
||||
? $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)") // username without the database list
|
||||
: $databases[(information_schema($databases[0]) ? 1 : 0)] // first available database
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function databases($flush = true) {
|
||||
|
|
Loading…
Reference in a new issue