WordPress.org

Make WordPress Core

Ticket #10543: wp-includes-taxonomy.php.patch

File wp-includes-taxonomy.php.patch, 1.2 KB (added by miqrogroove, 12 years ago)
  • wp-includes/taxonomy.php

     
    10031003                // Back compat filters
    10041004                if ( 'slug' == $field )
    10051005                        $value = apply_filters('pre_category_nicename', $value);
     1006                // DB validation
     1007                $value = wp_check_invalid_utf8($value, TRUE);
    10061008
    10071009        } else if ( 'rss' == $context ) {
    10081010                $value = apply_filters("term_${field}_rss", $value, $taxonomy);
     
    13581360        if ( is_int($term) && 0 == $term )
    13591361                return new WP_Error('invalid_term_id', __('Invalid term ID'));
    13601362
    1361         if ( '' == trim($term) )
    1362                 return new WP_Error('empty_term_name', __('A name is required for this term'));
    1363 
    13641363        $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
    13651364        $args = wp_parse_args($args, $defaults);
    13661365        $args['name'] = $term;
     
    13681367        $args = sanitize_term($args, $taxonomy, 'db');
    13691368        extract($args, EXTR_SKIP);
    13701369
     1370        if ( '' == trim($name) )
     1371                return new WP_Error('empty_term_name', __('A name is required for this term'));
     1372
    13711373        // expected_slashed ($name)
    13721374        $name = stripslashes($name);
    13731375        $description = stripslashes($description);