Make WordPress Core

Changeset 13537


Ignore:
Timestamp:
03/01/2010 08:33:03 PM (15 years ago)
Author:
ryan
Message:

Die if invalid post type is passed. see #9674

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r13273 r13537  
    2121}
    2222
    23 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
     23if ( !isset($_GET['post_type']) )
     24    $post_type = 'post';
     25elseif ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
    2426    $post_type = $_GET['post_type'];
    2527else
    26     $post_type = 'post';
     28    wp_die( __('Invalid post type') );
    2729$_GET['post_type'] = $post_type;
    2830
  • trunk/wp-admin/post-new.php

    r13101 r13537  
    1010require_once('admin.php');
    1111
    12 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
     12if ( !isset($_GET['post_type']) )
     13    $post_type = 'post';
     14elseif ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
    1315    $post_type = $_GET['post_type'];
    1416else
    15     $post_type = 'post';
     17    wp_die( __('Invalid post type') );
    1618
    1719if ( 'post' != $post_type ) {
Note: See TracChangeset for help on using the changeset viewer.