diff --git a/adminer/call.inc.php b/adminer/call.inc.php
index 5c1ba945..0407474b 100644
--- a/adminer/call.inc.php
+++ b/adminer/call.inc.php
@@ -58,7 +58,7 @@ if ($in) {
echo "
";
- echo "" . html_select("source[" . intval($key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
- echo " | " . html_select("target[" . intval($key) . "]", $target, $row["target"][$key]);
+ echo " | " . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
+ echo " | " . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]);
$j++;
}
?>
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index ff9ef98a..1331e5f3 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -640,7 +640,7 @@ function process_input($field) {
if ($value == "") {
return "NULL";
}
- return intval($value);
+ return +$value;
}
if ($field["auto_increment"] && $value == "") {
return null;
diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php
index afb91270..090d86af 100644
--- a/adminer/indexes.inc.php
+++ b/adminer/indexes.inc.php
@@ -21,7 +21,7 @@ if ($_POST && !$error && !$_POST["add"]) {
foreach ($index["columns"] as $key => $column) {
if ($column != "") {
$length = $index["lengths"][$key];
- $set[] = idf_escape($column) . ($length ? "(" . intval($length) . ")" : "");
+ $set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "");
$columns[] = $column;
$lengths[] = ($length ? $length : null);
}
diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index 9edc14cc..e0ae7875 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -212,7 +212,7 @@ if (!$columns) {
$page = floor(max(0, $found_rows - 1) / $limit);
}
- $query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
+ $query = "SELECT" . limit((+$limit && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? +$limit : null), ($page ? $limit * $page : 0), "\n");
echo $adminer->selectQuery($query);
$result = $connection->query($query);
@@ -230,7 +230,7 @@ if (!$columns) {
}
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
if ($_GET["page"] != "last") {
- $found_rows = (intval($limit) && $group && count($group) < count($select)
+ $found_rows = (+$limit && $group && count($group) < count($select)
? ($jush == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode
: count($rows)
);
@@ -292,7 +292,7 @@ if (!$columns) {
if ($val == "") {
$val = " ";
} elseif ($text_length != "" && ereg('text|blob', $field["type"]) && is_utf8($val)) {
- $val = shorten_utf8($val, max(0, intval($text_length))); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
+ $val = shorten_utf8($val, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
} else {
$val = h($val);
}
@@ -354,7 +354,7 @@ if (!$columns) {
if ($rows || $page) {
$exact_count = true;
- if ($_GET["page"] != "last" && intval($limit) && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
+ if ($_GET["page"] != "last" && +$limit && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
$found_rows = $table_status["Rows"];
if (!isset($found_rows) || $where || 2 * $page * $limit > $found_rows || ($table_status["Engine"] == "InnoDB" && $found_rows < 1e4)) {
// slow with big tables
@@ -366,7 +366,7 @@ if (!$columns) {
}
}
echo " ";
- if (intval($limit) && $found_rows > $limit) {
+ if (+$limit && $found_rows > $limit) {
// display first, previous 4, next 4 and last page
$max_page = floor(($found_rows - 1) / $limit);
echo '" . lang('Page') . ":" . pagination(0, $page) . ($page > 5 ? " ..." : "");
|