Make WordPress Core

Ticket #18718: 18718.3.patch

File 18718.3.patch, 1006 bytes (added by johnbillion, 12 years ago)
  • wp-admin/edit-tags.php

     
    113113case 'edit':
    114114        $title = $tax->labels->edit_item;
    115115
    116         require_once ( 'admin-header.php' );
    117116        $tag_ID = (int) $_REQUEST['tag_ID'];
    118117
    119118        $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
     119        if ( !$tag )
     120                wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
     121        require_once ( 'admin-header.php' );
    120122        include( './edit-tag-form.php' );
    121123
    122124break;
     
    128130        if ( !current_user_can( $tax->cap->edit_terms ) )
    129131                wp_die( __( 'Cheatin’ uh?' ) );
    130132
     133        $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
     134        if ( !$tag )
     135                wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
     136
    131137        $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
    132138
    133139        $location = 'edit-tags.php?taxonomy=' . $taxonomy;