WordPress.org

Make WordPress Core

Ticket #18718: 18718.2.patch

File 18718.2.patch, 947 bytes (added by johnbillion, 3 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        if ( !$tag ) 
     134                wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); 
     135 
    131136        $ret = wp_update_term( $tag_ID, $taxonomy, $_POST ); 
    132137 
    133138        $location = 'edit-tags.php?taxonomy=' . $taxonomy;