diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 0447e953..9985df17 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -444,7 +444,7 @@ if (!defined('Adminer\DRIVER')) { /** Connect to the database * @param array{string, string, string} [$server, $username, $password] - * @return mixed Db or string for error + * @return string|Db string for error */ function connect($credentials) { global $drivers; @@ -1073,47 +1073,12 @@ if (!defined('Adminer\DRIVER')) { /** Get approximate number of rows * @param TableStatus * @param list - * @return numeric-string|void null if approximate number can't be retrieved + * @return numeric-string|null null if approximate number can't be retrieved */ function found_rows($table_status, $where) { return ($where || $table_status["Engine"] != "InnoDB" ? null : $table_status["Rows"]); } - /* Not used is MySQL but checked in compile.php: - /** Get user defined types - * @return string[] [$id => $name] - function types() { - return array(); - } - - /** Get values of user defined type - * @param int - * @return string - function type_values($id) { - return ""; - } - - /** Get existing schemas - * @return list - function schemas() { - return array(); - } - - /** Get current schema - * @return string - function get_schema() { - return ""; - } - - /** Set current schema - * @param string - * @param Db - * @return bool - function set_schema($schema, $connection2 = null) { - return true; - } - */ - /** Get SQL command to create table * @param string * @param bool @@ -1241,4 +1206,44 @@ if (!defined('Adminer\DRIVER')) { function max_connections() { return get_val("SELECT @@max_connections"); } + + // Not used is MySQL but checked in compile.php: + + /** Get user defined types + * @return string[] [$id => $name] + */ + function types() { + return array(); + } + + /** Get values of user defined type + * @param int + * @return string + */ + function type_values($id) { + return ""; + } + + /** Get existing schemas + * @return list + */ + function schemas() { + return array(); + } + + /** Get current schema + * @return string + */ + function get_schema() { + return ""; + } + + /** Set current schema + * @param string + * @param Db + * @return bool + */ + function set_schema($schema, $connection2 = null) { + return true; + } } diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 82e7166f..490ffdfe 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -854,7 +854,7 @@ AND typelem = 0" } $fields = fields($table); - if (!$status || empty($fields)) { + if (count($status) < 2 || empty($fields)) { return false; } diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index ebf3b63f..9a0ff67d 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -61,6 +61,7 @@ function check_invalid_login() { break; } } + /** @var array{int, int} */ $invalid = idx($invalids, $adminer->bruteForceKey(), array()); $next_attempt = ($invalid[1] > 29 ? $invalid[0] - time() : 0); // allow 30 invalid attempts if ($next_attempt > 0) { //! do the same with permanent login diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 9981b43b..97a492bc 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -124,7 +124,7 @@ function referencable_primary($self) { /** Print SQL