Make WordPress Core

Changeset 18954


Ignore:
Timestamp:
10/12/2011 08:30:50 PM (13 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

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

    r18911 r18954  
    114114    $title = $tax->labels->edit_item;
    115115
     116    $tag_ID = (int) $_REQUEST['tag_ID'];
     117
     118    $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?' ) );
    116121    require_once ( 'admin-header.php' );
    117     $tag_ID = (int) $_REQUEST['tag_ID'];
    118 
    119     $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
    120122    include( './edit-tag-form.php' );
    121123
     
    128130    if ( !current_user_can( $tax->cap->edit_terms ) )
    129131        wp_die( __( 'Cheatin’ uh?' ) );
     132 
     133    $tag = get_term( $tag_ID, $taxonomy );
     134    if ( ! $tag )
     135        wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
    130136
    131137    $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
Note: See TracChangeset for help on using the changeset viewer.