Die when attempting to edit non-existent term. Props johnbillion. fixes #18718

git-svn-id: http://svn.automattic.com/wordpress/trunk@18954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-10-12 20:30:50 +00:00
parent 28a6d49c1a
commit c28bd6af03
1 changed files with 7 additions and 1 deletions

View File

@ -113,10 +113,12 @@ break;
case 'edit':
$title = $tax->labels->edit_item;
require_once ( 'admin-header.php' );
$tag_ID = (int) $_REQUEST['tag_ID'];
$tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
if ( ! $tag )
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
require_once ( 'admin-header.php' );
include( './edit-tag-form.php' );
break;
@ -127,6 +129,10 @@ case 'editedtag':
if ( !current_user_can( $tax->cap->edit_terms ) )
wp_die( __( 'Cheatin’ uh?' ) );
$tag = get_term( $tag_ID, $taxonomy );
if ( ! $tag )
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );