Ticket #31954: 31954.patch
File 31954.patch, 1.0 KB (added by , 10 years ago) |
---|
-
src/wp-includes/taxonomy.php
3376 3376 if ( is_wp_error( $term ) ) 3377 3377 return $term; 3378 3378 3379 if ( null === $term ) { 3380 return new WP_Error( 'invalid_term', __( 'Empty term' ) ); 3381 } 3382 3379 3383 // Escape data pulled from DB. 3380 3384 $term = wp_slash($term); 3381 3385 -
tests/phpunit/tests/term/wpUpdateTerm.php
653 653 654 654 _unregister_taxonomy( 'wptests_tax' ); 655 655 } 656 657 public function test_wp_update_term_with_null_get_term() { 658 $t = $this->factory->term->create( array( 'taxonomy' => 'category' ) ); 659 $found = wp_update_term( $t, 'post_tag', array( 'slug' => 'foo' ) ); 660 661 $this->assertWPError( $found ); 662 $this->assertSame( 'invalid_term', $found->get_error_code() ); 663 } 656 664 }