Changeset 55707
- Timestamp:
- 05/03/2023 11:55:26 AM (18 months ago)
- Location:
- branches/6.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.2/src/wp-includes/html-api/class-wp-html-tag-processor.php
r55668 r55707 2103 2103 */ 2104 2104 if ( $requires_no_updating && $this->bytes_already_copied > 0 ) { 2105 $this->html = $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); 2106 $this->bytes_already_copied = strlen( $this->output_buffer ); 2105 2107 return $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); 2106 2108 } -
branches/6.2/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r55668 r55707 405 405 'Casting WP_HTML_Tag_Processor to a string without performing any updates did not return the initial HTML snippet' 406 406 ); 407 } 408 409 /** 410 * Ensures that when seeking to an earlier spot in the document that 411 * all previously-enqueued updates are applied as they ought to be. 412 * 413 * @ticket 58160 414 */ 415 public function test_get_updated_html_applies_updates_to_content_after_seeking_to_before_parsed_bytes() { 416 $p = new WP_HTML_Tag_Processor( '<div><img hidden></div>' ); 417 418 $p->next_tag(); 419 $p->set_attribute( 'wonky', true ); 420 $p->next_tag(); 421 $p->set_bookmark( 'here' ); 422 423 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 424 $p->seek( 'here' ); 425 426 $this->assertSame( '<div wonky><img hidden></div>', $p->get_updated_html() ); 407 427 } 408 428
Note: See TracChangeset
for help on using the changeset viewer.