Changeset 42249 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 11/28/2017 04:23:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r42228 r42249 618 618 619 619 if ( ! isset( $regex ) ) { 620 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation 620 621 $comments = 621 '!' // Start of comment, after the <.622 '!' // Start of comment, after the <. 622 623 . '(?:' // Unroll the loop: Consume everything until --> is found. 623 624 . '-(?!->)' // Dash not followed by end of comment. … … 627 628 628 629 $cdata = 629 '!\[CDATA\[' // Start of comment, after the <.630 '!\[CDATA\[' // Start of comment, after the <. 630 631 . '[^\]]*+' // Consume non-]. 631 632 . '(?:' // Unroll the loop: Consume everything until ]]> is found. … … 636 637 637 638 $escaped = 638 '(?=' // Is the element escaped?639 '(?=' // Is the element escaped? 639 640 . '!--' 640 641 . '|' … … 648 649 649 650 $regex = 650 '/(' // Capture the entire match.651 '/(' // Capture the entire match. 651 652 . '<' // Find start of element. 652 653 . '(?' // Conditional expression follows. … … 656 657 . ')' 657 658 . ')/'; 659 // phpcs:enable 658 660 } 659 661 … … 678 680 679 681 if ( ! isset( $html_regex ) ) { 682 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation 680 683 $comment_regex = 681 '!' // Start of comment, after the <.684 '!' // Start of comment, after the <. 682 685 . '(?:' // Unroll the loop: Consume everything until --> is found. 683 686 . '-(?!->)' // Dash not followed by end of comment. … … 687 690 688 691 $html_regex = // Needs replaced with wp_html_split() per Shortcode API Roadmap. 689 '<' // Find start of element.692 '<' // Find start of element. 690 693 . '(?(?=!--)' // Is this a comment? 691 694 . $comment_regex // Find end of comment. … … 693 696 . '[^>]*>?' // Find end of element. If not found, match all input. 694 697 . ')'; 698 // phpcs:enable 695 699 } 696 700 … … 718 722 $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); 719 723 $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex(). 724 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation 720 725 $regex = 721 726 '\[' // Find start of shortcode. … … 729 734 . '\]' // Find end of shortcode. 730 735 . '\]?'; // Shortcodes may end with ]] 736 // phpcs:enable 731 737 732 738 return $regex; … … 818 824 $spaces = wp_spaces_regexp(); 819 825 826 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation 820 827 $pattern = 821 828 '/' … … 849 856 . '<\\/p>' // closing paragraph 850 857 . '/'; 858 // phpcs:enable 851 859 852 860 return preg_replace( $pattern, '$1', $pee );
Note: See TracChangeset
for help on using the changeset viewer.