Die if invalid post type is passed. see #9674
git-svn-id: http://svn.automattic.com/wordpress/trunk@13537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d71efc7362
commit
9f0db9355a
|
@ -20,10 +20,12 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag
|
||||||
unset( $_redirect );
|
unset( $_redirect );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
|
if ( !isset($_GET['post_type']) )
|
||||||
|
$post_type = 'post';
|
||||||
|
elseif ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
|
||||||
$post_type = $_GET['post_type'];
|
$post_type = $_GET['post_type'];
|
||||||
else
|
else
|
||||||
$post_type = 'post';
|
wp_die( __('Invalid post type') );
|
||||||
$_GET['post_type'] = $post_type;
|
$_GET['post_type'] = $post_type;
|
||||||
|
|
||||||
$post_type_object = get_post_type_object($post_type);
|
$post_type_object = get_post_type_object($post_type);
|
||||||
|
|
|
@ -9,10 +9,12 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
|
if ( !isset($_GET['post_type']) )
|
||||||
|
$post_type = 'post';
|
||||||
|
elseif ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
|
||||||
$post_type = $_GET['post_type'];
|
$post_type = $_GET['post_type'];
|
||||||
else
|
else
|
||||||
$post_type = 'post';
|
wp_die( __('Invalid post type') );
|
||||||
|
|
||||||
if ( 'post' != $post_type ) {
|
if ( 'post' != $post_type ) {
|
||||||
$parent_file = "edit.php?post_type=$post_type";
|
$parent_file = "edit.php?post_type=$post_type";
|
||||||
|
|
Loading…
Reference in New Issue