diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 791dca36..ecd15599 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -134,8 +134,8 @@ function remove_from_uri($param = "") {
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));
}
-function print_pagination($page) {
- echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . "");
+function pagination($page) {
+ return " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . "");
}
function get_file($key) {
diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index b519a548..d1765734 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -335,18 +335,11 @@ if (!$columns) {
if (intval($limit) && $found_rows > $limit) {
// display first, previous 3, next 3 and last page
$max_page = floor(($found_rows - 1) / $limit);
- echo lang('Page') . ":";
- print_pagination(0);
- if ($_GET["page"] > 3) {
- echo " ...";
- }
+ echo lang('Page') . ":" . pagination(0) . ($_GET["page"] > 3 ? " ..." : "");
for ($i = max(1, $_GET["page"] - 2); $i < min($max_page, $_GET["page"] + 3); $i++) {
- print_pagination($i);
+ echo pagination($i);
}
- if ($_GET["page"] + 3 < $max_page) {
- echo " ...";
- }
- print_pagination($max_page);
+ echo ($_GET["page"] + 3 < $max_page ? " ..." : "") . pagination($max_page);
}
echo " (" . lang('%d row(s)', $found_rows) . ') \n";