Changeset 36348
- Timestamp:
- 01/19/2016 04:09:32 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r36323 r36348 1355 1355 $names = (array) $args['name']; 1356 1356 foreach ( $names as &$_name ) { 1357 $_name = sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' ); 1357 // `sanitize_term_field()` returns slashed data. 1358 $_name = stripslashes( sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' ) ); 1358 1359 } 1359 1360 -
trunk/tests/phpunit/tests/term/getTerms.php
r36252 r36348 560 560 'name' => array( 'Foo & Bar' ), 561 561 ) ); 562 $this->assertEqualSets( array( $t ), $found ); 563 } 564 565 /** 566 * @ticket 35493 567 */ 568 public function test_name_should_not_double_escape_apostrophes() { 569 register_taxonomy( 'wptests_tax', 'post' ); 570 571 $name = "Foo'Bar"; 572 573 $t = self::factory()->term->create( array( 574 'taxonomy' => 'wptests_tax', 575 'name' => $name, 576 ) ); 577 578 $term = get_term( $t, 'wptests_tax' ); 579 580 $this->assertSame( $name, $term->name ); 581 582 $found = get_terms( 'wptests_tax', array( 583 'hide_empty' => false, 584 'fields' => 'ids', 585 'name' => $name, 586 ) ); 587 562 588 $this->assertEqualSets( array( $t ), $found ); 563 589 }
Note: See TracChangeset
for help on using the changeset viewer.