diff --git a/server_databases.php b/server_databases.php index 1e7fedfae..98a42ea62 100644 --- a/server_databases.php +++ b/server_databases.php @@ -19,20 +19,17 @@ if (empty($_REQUEST['sort_by'])) { } else { $sort_by = PMA_sanitize($_REQUEST['sort_by']); } -if (empty($_REQUEST['sort_order'])) { - if ($sort_by == 'SCHEMA_NAME') { - $sort_order = 'asc'; - } else { - $sort_order = 'desc'; - } + +if (isset($_REQUEST['sort_order']) + && strtoupper($_REQUEST['sort_order']) == 'DESC') { + $sort_order = 'DESC'; } else { - $sort_order = PMA_sanitize($_REQUEST['sort_order']); + $sort_order = 'ASC'; } $dbstats = empty($_REQUEST['dbstats']) ? 0 : 1; $pos = empty($_REQUEST['pos']) ? 0 : (int) $_REQUEST['pos']; -$sort_by = empty($_REQUEST['sort_by']) ? 'SCHEMA_NAME' : $_REQUEST['sort_by']; -$sort_order = empty($_REQUEST['sort_order']) ? 'ASC' : $_REQUEST['sort_order']; + /** * Drops multiple databases @@ -142,9 +139,15 @@ if ($databases_count > 0) { 'footer' => 0, ); + $_url_params = array( + 'pos' => $pos, + 'dbstats' => $dbstats, + 'sort_by' => $sort_by, + 'sort_order' => $sort_order, + ); + if ($GLOBALS['cfg']['MaxDbList'] && $GLOBALS['cfg']['MaxDbList'] < $databases_count) { - $_url_params = array(); // Move to the beginning or to the previous page if ($pos > 0) { // loic1: patch #474210 from Gosha Sakovich - part 1 @@ -169,9 +172,10 @@ if ($databases_count > 0) { . $caption2 . ''; } - echo '
'; @@ -198,16 +202,19 @@ if ($databases_count > 0) { } } + $_url_params['pos'] = $pos; + echo '