WordPress.org

Make WordPress Core

Ticket #9397: 9397v2.diff

File 9397v2.diff, 388 bytes (added by jhodgdon, 9 years ago)

Better patch - trims before creating slugs (see comments below)

  • wp-includes/taxonomy.php

     
    865865                        return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
    866866        }
    867867
     868    $term = trim( $term );
     869   
    868870        if ( '' === $slug = sanitize_title($term) )
    869871                return 0;
    870872