WordPress.org

Make WordPress Core

Changeset 4490


Ignore:
Timestamp:
11/19/06 01:12:36 (8 years ago)
Author:
ryan
Message:

Don't allow a category to be it's own parent. Props donncha. fixes #3278

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r4364 r4490  
    151151 
    152152    $cat_ID = (int) $catarr['cat_ID']; 
     153 
     154    if( $cat_ID == $catarr['category_parent'] ) 
     155        return false; 
    153156 
    154157    // First, get all of the original fields 
  • trunk/wp-admin/categories.php

    r4480 r4490  
    6363        wp_die(__('Cheatin’ uh?')); 
    6464 
    65     wp_update_category($_POST); 
     65    if ( wp_update_category($_POST) ) 
     66        wp_redirect('categories.php?message=3');  
     67    else 
     68        wp_redirect('categories.php?message=5');  
    6669 
    67     wp_redirect('categories.php?message=3'); 
    6870    exit; 
    6971break; 
     
    7880$messages[3] = __('Category updated.'); 
    7981$messages[4] = __('Category not added.'); 
     82$messages[5] = __('Category not updated.'); 
    8083?> 
    8184 
Note: See TracChangeset for help on using the changeset viewer.