Properly check, initialize, or cast a number of variables. props ChenHui. see #14642.

git-svn-id: https://develop.svn.wordpress.org/trunk@16377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-11-15 06:38:10 +00:00
parent 420e436d72
commit 8d9b2cd2b3
4 changed files with 11 additions and 10 deletions

View File

@@ -13,12 +13,13 @@ $wp_list_table = get_list_table('WP_Posts_List_Table');
$wp_list_table->check_permissions();
// Back-compat for viewing comments of an entry
if ( $_redirect = intval( max( @$_REQUEST['p'], @$_REQUEST['attachment_id'], @$_REQUEST['page_id'] ) ) ) {
wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
exit;
} else {
unset( $_redirect );
foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
exit;
}
}
unset( $_redirect );
// Handle bulk actions
$doaction = $wp_list_table->current_action();