Changeset 55675
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r55674 r55675 2143 2143 */ 2144 2144 if ( $requires_no_updating && $this->bytes_already_copied > 0 ) { 2145 $this->html = $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); 2146 $this->bytes_already_copied = strlen( $this->output_buffer ); 2145 2147 return $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); 2146 2148 } -
trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r55667 r55675 458 458 459 459 /** 460 * Ensures that when seeking to an earlier spot in the document that 461 * all previously-enqueued updates are applied as they ought to be. 462 * 463 * @ticket 58160 464 */ 465 public function test_get_updated_html_applies_updates_to_content_after_seeking_to_before_parsed_bytes() { 466 $p = new WP_HTML_Tag_Processor( '<div><img hidden></div>' ); 467 468 $p->next_tag(); 469 $p->set_attribute( 'wonky', true ); 470 $p->next_tag(); 471 $p->set_bookmark( 'here' ); 472 473 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 474 $p->seek( 'here' ); 475 476 $this->assertSame( '<div wonky><img hidden></div>', $p->get_updated_html() ); 477 } 478 479 /** 460 480 * @ticket 56299 461 481 *
Note: See TracChangeset
for help on using the changeset viewer.