Changeset 4022

Show
Ignore:
Timestamp:
07/20/06 01:30:37 (2 years ago)
Author:
ryan
Message:

Don't allow blank cats. Props donncha. fixes #2960

Files:

Legend:

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

    r4020 r4022  
    8484 
    8585    extract($catarr); 
     86 
     87    if( trim( $cat_name ) == '' ) 
     88        return 0; 
    8689 
    8790    $cat_ID = (int) $cat_ID; 
  • trunk/wp-admin/categories.php

    r4006 r4022  
    1616        wp_die(__('Cheatin’ uh?')); 
    1717 
    18     wp_insert_category($_POST); 
    19  
    20     wp_redirect('categories.php?message=1#addcat'); 
     18    if( wp_insert_category($_POST ) ) { 
     19        wp_redirect('categories.php?message=1#addcat'); 
     20    } else { 
     21        wp_redirect('categories.php?message=4#addcat'); 
     22    } 
    2123break; 
    2224 
     
    7274$messages[2] = __('Category deleted.'); 
    7375$messages[3] = __('Category updated.'); 
     76$messages[4] = __('Category not added.'); 
    7477?> 
    7578