- Timestamp:
- 08/10/2023 08:35:55 AM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r56376 r56380 350 350 public function next_tag( $query = null ) { 351 351 if ( null === $query ) { 352 return $this->step(); 352 while ( $this->step() ) { 353 if ( ! $this->is_tag_closer() ) { 354 return true; 355 } 356 } 357 358 return false; 353 359 } 354 360 … … 367 373 368 374 if ( ! ( array_key_exists( 'breadcrumbs', $query ) && is_array( $query['breadcrumbs'] ) ) ) { 369 return $this->step(); 375 while ( $this->step() ) { 376 if ( ! $this->is_tag_closer() ) { 377 return true; 378 } 379 } 380 381 return false; 370 382 } 371 383 … … 384 396 $crumb = end( $breadcrumbs ); 385 397 $target = strtoupper( $crumb ); 386 while ( $ this->step() ) {398 while ( $match_offset > 0 && $this->step() ) { 387 399 if ( $target !== $this->get_tag() ) { 388 400 continue; … … 396 408 397 409 $crumb = prev( $breadcrumbs ); 398 if ( false === $crumb && 0 === --$match_offset ) {410 if ( false === $crumb && 0 === --$match_offset && ! $this->is_tag_closer() ) { 399 411 return true; 400 412 } … … 511 523 512 524 switch ( $op ) { 525 /* 526 * > A start tag whose tag name is "button" 527 */ 528 case '+BUTTON': 529 if ( $this->state->stack_of_open_elements->has_element_in_scope( 'BUTTON' ) ) { 530 // @TODO: Indicate a parse error once it's possible. This error does not impact the logic here. 531 $this->generate_implied_end_tags(); 532 $this->state->stack_of_open_elements->pop_until( 'BUTTON' ); 533 } 534 535 $this->reconstruct_active_formatting_elements(); 536 $this->insert_html_element( $this->current_token ); 537 $this->state->frameset_ok = false; 538 539 return true; 540 513 541 /* 514 542 * > A start tag whose tag name is one of: "address", "article", "aside", … … 536 564 */ 537 565 case '-BLOCKQUOTE': 566 case '-BUTTON': 538 567 case '-DIV': 539 568 case '-FIGCAPTION': 540 569 case '-FIGURE': 541 570 if ( ! $this->state->stack_of_open_elements->has_element_in_scope( $tag_name ) ) { 571 // @TODO: Report parse error. 542 572 // Ignore the token. 543 573 return $this->step(); … … 545 575 546 576 $this->generate_implied_end_tags(); 577 if ( $this->state->stack_of_open_elements->current_node()->node_name !== $tag_name ) { 578 // @TODO: Record parse error: this error doesn't impact parsing. 579 } 547 580 $this->state->stack_of_open_elements->pop_until( $tag_name ); 548 581 return true;
Note: See TracChangeset
for help on using the changeset viewer.