Validate pagination input. Props batmoo. See #15580

git-svn-id: https://develop.svn.wordpress.org/trunk@16644 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-12-01 06:02:19 +00:00
parent 4ba9c5d14a
commit d04665df0e
3 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -149,8 +149,11 @@ listTable.init();
// Ajaxify various UI elements
function change_page(paged, $el) {
if ( paged < 1 || paged > listTable.get_total_pages() )
return false;
if ( paged < 1 )
paged = 1;
if ( paged > listTable.get_total_pages() )
paged = listTable.get_total_pages();
listTable.update_rows({'paged': paged}, false, function() {
if ( $el.parents('.tablenav.bottom').length )
@@ -189,7 +192,7 @@ listTable.init();
var $el = $(this);
change_page(parseInt($el.val()), $el);
change_page(parseInt($el.val()) || 1, $el);
return false;
});