WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2010 06:38:10 AM (10 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit.php

    r16175 r16377  
    1414
    1515// Back-compat for viewing comments of an entry
    16 if ( $_redirect = intval( max( @$_REQUEST['p'], @$_REQUEST['attachment_id'], @$_REQUEST['page_id'] ) ) ) {
    17     wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
    18     exit;
    19 } else {
    20     unset( $_redirect );
    21 }
     16foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
     17    if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
     18        wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
     19        exit;
     20    }
     21}
     22unset( $_redirect );
    2223
    2324// Handle bulk actions
Note: See TracChangeset for help on using the changeset viewer.