Changeset 8393

Show
Ignore:
Timestamp:
07/21/08 21:53:32 (4 months ago)
Author:
ryan
Message:

Don't allow empty term names. Props scohoust. fixes #7336 for trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/taxonomy.php

    r8377 r8393  
    12001200        return new WP_Error('invalid_term_id', __('Invalid term ID')); 
    12011201 
     1202    if ( '' == trim($term) ) 
     1203        return new WP_Error('empty_term_name', __('A name is required for this term')); 
     1204 
    12021205    $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); 
    12031206    $args = wp_parse_args($args, $defaults); 
     
    14691472    $name = stripslashes($name); 
    14701473    $description = stripslashes($description); 
     1474 
     1475    if ( '' == trim($name) ) 
     1476        return new WP_Error('empty_term_name', __('A name is required for this term')); 
    14711477 
    14721478    $empty_slug = false;