[wp-trac] [WordPress Trac] #21593: register_taxonomy() doesn't fail when taxonomy name too long (was: create_taxonomy() doesn't fail when taxonomy name too long)

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 15 16:30:31 UTC 2012


#21593: register_taxonomy() doesn't fail when taxonomy name too long
--------------------------+------------------------------
 Reporter:  psbook        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  3.4.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Old description:

> The 'taxonomy' field of the 'term_taxonomy' table is VARCHAR(32), ie
> truncated at 32 characters. But create_taxonomy() doesn't fail when you
> try to create a taxonomy with a unique name longer than this.
>
> The effects are that terms can be added to 'terms' table along with
> corresponding entries in 'term_taxonomy', but that these can't be read
> back again. The taxonomy appears in the admin menus, but appears to be
> totally empty.

New description:

 The 'taxonomy' field of the 'term_taxonomy' table is VARCHAR(32), ie
 truncated at 32 characters. But register_taxonomy() doesn't fail when you
 try to create a taxonomy with a unique name longer than this.

 The effects are that terms can be added to 'terms' table along with
 corresponding entries in 'term_taxonomy', but that these can't be read
 back again. The taxonomy appears in the admin menus, but appears to be
 totally empty.

--

Comment (by nacin):

 In register_post_type(), we do:

 {{{
 if ( strlen( $post_type ) > 20 )
                 return new WP_Error( 'post_type_too_long', __( 'Post types
 cannot exceed 20 characters in length' ) );
 }}}

 Seems like a good thing here.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21593#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list