Prevent PHP 7.1 warning about non-numeric values
This commit is contained in:
parent
329fa55af5
commit
72b199378a
|
@ -129,7 +129,7 @@ if (isset($_GET["mongo"])) {
|
|||
return new Min_Result($this->_conn->_db->selectCollection($table)
|
||||
->find(array(), $select)
|
||||
->sort($sort)
|
||||
->limit(+$limit)
|
||||
->limit($limit != "" ? +$limit : 0)
|
||||
->skip($page * $limit)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -655,7 +655,7 @@ focus(qs('#username'));
|
|||
} elseif (preg_match('~^([+-]|\\|\\|)$~', $function)) {
|
||||
$return = idf_escape($name) . " $function $return";
|
||||
} elseif (preg_match('~^[+-] interval$~', $function)) {
|
||||
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
|
||||
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+\$~i", $value) ? $value : $return);
|
||||
} elseif (preg_match('~^(addtime|subtime|concat)$~', $function)) {
|
||||
$return = "$function(" . idf_escape($name) . ", $return)";
|
||||
} elseif (preg_match('~^(md5|sha1|password|encrypt)$~', $function)) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
|
||||
if (!$query) {
|
||||
$query = "SELECT" . limit(
|
||||
($_GET["page"] != "last" && +$limit && $group && $is_group && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
|
||||
($_GET["page"] != "last" && $limit != "" && $group && $is_group && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
|
||||
($where ? "\nWHERE " . implode(" AND ", $where) : "") . ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""),
|
||||
($limit != "" ? +$limit : null),
|
||||
($page ? $limit * $page : 0),
|
||||
|
|
|
@ -288,7 +288,7 @@ if (!$columns && support("table")) {
|
|||
}
|
||||
|
||||
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
|
||||
if ($_GET["page"] != "last" && +$limit && $group && $is_group && $jush == "sql") {
|
||||
if ($_GET["page"] != "last" && $limit != "" && $group && $is_group && $jush == "sql") {
|
||||
$found_rows = $connection->result(" SELECT FOUND_ROWS()"); // space to allow mysql.trace_mode
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ if (!$columns && support("table")) {
|
|||
if (($rows || $page) && !is_ajax()) {
|
||||
$exact_count = true;
|
||||
if ($_GET["page"] != "last") {
|
||||
if (!+$limit) {
|
||||
if ($limit == "") {
|
||||
$found_rows = count($rows);
|
||||
} elseif ($jush != "sql" || !$is_group) {
|
||||
$found_rows = ($is_group ? false : found_rows($table_status, $where));
|
||||
|
@ -453,7 +453,7 @@ if (!$columns && support("table")) {
|
|||
}
|
||||
}
|
||||
|
||||
if (+$limit && ($found_rows === false || $found_rows > $limit || $page)) {
|
||||
if ($limit != "" && ($found_rows === false || $found_rows > $limit || $page)) {
|
||||
echo "<p class='pages'>";
|
||||
// display first, previous 4, next 4 and last page
|
||||
$max_page = ($found_rows === false
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Adminer 4.3.2-dev:
|
||||
PHP 7.1: Prevent warning when using empty limit
|
||||
MySQL: Remove dedicated view for replication status (added in 4.3.0)
|
||||
PostgreSQL: Sort table names (regression from 4.3.1)
|
||||
Editor: Don't set time zone from PHP, fixes DST
|
||||
|
|
Loading…
Reference in a new issue