Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r58870 r58893 4010 4010 4011 4011 // Does the tag name match the requested tag name in a case-insensitive manner? 4012 if ( isset( $this->sought_tag_name ) && 0 !== substr_compare( $this->html, $this->sought_tag_name, $this->tag_name_starts_at, $this->tag_name_length, true ) ) { 4012 if ( 4013 isset( $this->sought_tag_name ) && 4014 ( 4015 strlen( $this->sought_tag_name ) !== $this->tag_name_length || 4016 0 !== substr_compare( $this->html, $this->sought_tag_name, $this->tag_name_starts_at, $this->tag_name_length, true ) 4017 ) 4018 ) { 4013 4019 return false; 4014 4020 } -
trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r58858 r58893 600 600 601 601 $this->assertFalse( $processor->next_tag( 'p' ), 'Querying a non-existing tag did not return false' ); 602 } 603 604 /** 605 * @ticket 61545 606 */ 607 public function test_next_tag_should_not_match_on_substrings_of_a_requested_tag() { 608 $processor = new WP_HTML_Tag_Processor( '<p><pic><picture>' ); 609 610 $this->assertTrue( 611 $processor->next_tag( 'PICTURE' ), 612 'Failed to find a tag when requested: check test setup.' 613 ); 614 615 $this->assertSame( 616 'PICTURE', 617 $processor->get_tag(), 618 'Should have skipped past substring tag matches, directly finding the PICTURE element.' 619 ); 620 621 $processor = new WP_HTML_Tag_Processor( '<p><pic>' ); 622 623 $this->assertFalse( 624 $processor->next_tag( 'PICTURE' ), 625 "Should not have found any PICTURE element, but found '{$processor->get_token_name()}' instead." 626 ); 602 627 } 603 628
Note: See TracChangeset
for help on using the changeset viewer.