Ticket #31135: 31135.2.patch
File 31135.2.patch, 1.8 KB (added by , 10 years ago) |
---|
-
src/wp-includes/taxonomy.php
341 341 ); 342 342 $args = wp_parse_args( $args, $defaults ); 343 343 344 if ( strlen( $taxonomy ) > 32 ) { 345 _doing_it_wrong( __FUNCTION__, __( 'Taxonomies cannot exceed 32 characters in length' ), '4.0' ); 346 return new WP_Error( 'taxonomy_too_long', __( 'Taxonomies cannot exceed 32 characters in length' ) ); 344 $taxonomy_length = strlen( $taxonomy ); 345 if ( $taxonomy_length < 1 || $taxonomy_length > 32 ) { 346 _doing_it_wrong( __FUNCTION__, __( 'Taxonomies must be between 1 and 32 characters in length.' ), '4.2' ); 347 return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomies must be between 1 and 32 characters in length.' ) ); 347 348 } 348 349 349 350 if ( false !== $args['query_var'] && ! empty( $wp ) ) { -
tests/phpunit/tests/taxonomy.php
137 137 138 138 // clean up 139 139 unset($GLOBALS['wp_taxonomies'][$tax]); 140 141 // @ticket 31135 142 register_taxonomy( '', 'post' ); 143 $this->expected_doing_it_wrong[] = 'register_taxonomy'; 144 $this->assertFalse( taxonomy_exists( '' ) ); 145 unset($GLOBALS['wp_taxonomies']['']); 146 147 // @ticket 31135 148 register_taxonomy( 'taxonomy_name_longer_than_32_characters', 'post' ); 149 $this->expected_doing_it_wrong[] = 'register_taxonomy'; 150 $this->assertFalse( taxonomy_exists( 'taxonomy_name_longer_than_32_characters' ) ); 151 unset($GLOBALS['wp_taxonomies']['taxonomy_name_longer_than_32_characters']); 140 152 } 141 153 142 154 function test_register_hierarchical_taxonomy() {