Merge pull request #13262 from udan11/fix_13241

Redirect user to last page that has any tables to display.
This commit is contained in:
Michal Čihař 2017-05-15 09:48:35 +02:00 committed by GitHub
commit 8674361e46
2 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,7 @@ phpMyAdmin - ChangeLog
- issue #13256 Fixed password check on server replication
- issue #13252 Fixed grid editing time column
- issue #13258 Fixed detection of Amazon RDS
- issue #13241 Redirect user to last page that has any tables to display
4.7.0 (2017-03-28)
- patch #12233 [Display] Improve message when renaming database to same name

View File

@ -146,6 +146,18 @@ class DatabaseStructureController extends DatabaseController
// Gets the database structure
$this->_getDbInfo('_structure');
// Checks if there are any tables to be shown on current page.
// If there are no tables, the user is redirected to the last page
// having any.
if ($this->_total_num_tables > 0 && $this->_pos > $this->_total_num_tables) {
$uri = './db_structure.php' . URL::getCommonRaw(array(
'db' => $this->db,
'pos' => max(0, $this->_total_num_tables - $GLOBALS['cfg']['MaxTableList']),
'reload' => 1
));
PMA_sendHeaderLocation($uri);
}
include_once 'libraries/replication.inc.php';
PageSettings::showGroup('DbStructure');