WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/26/2017 11:56:25 PM (20 months ago)
Author:
pento
Message:

General: Fix some precision alignment formatting warnings.

The WPCS WordPress.WhiteSpace.PrecisionAlignment rule throws warnings for a bunch of code that will likely cause issues for wpcbf. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r42201 r42228  
    619619    if ( ! isset( $regex ) ) {
    620620        $comments =
    621               '!'           // Start of comment, after the <.
     621            '!'           // Start of comment, after the <.
    622622            . '(?:'         // Unroll the loop: Consume everything until --> is found.
    623623            .     '-(?!->)' // Dash not followed by end of comment.
     
    627627
    628628        $cdata =
    629               '!\[CDATA\['  // Start of comment, after the <.
     629            '!\[CDATA\['  // Start of comment, after the <.
    630630            . '[^\]]*+'     // Consume non-].
    631631            . '(?:'         // Unroll the loop: Consume everything until ]]> is found.
     
    636636
    637637        $escaped =
    638               '(?='           // Is the element escaped?
     638            '(?='           // Is the element escaped?
    639639            .    '!--'
    640640            . '|'
     
    648648
    649649        $regex =
    650               '/('              // Capture the entire match.
     650            '/('              // Capture the entire match.
    651651            .     '<'           // Find start of element.
    652652            .     '(?'          // Conditional expression follows.
     
    679679    if ( ! isset( $html_regex ) ) {
    680680        $comment_regex =
    681               '!'           // Start of comment, after the <.
     681            '!'           // Start of comment, after the <.
    682682            . '(?:'         // Unroll the loop: Consume everything until --> is found.
    683683            .     '-(?!->)' // Dash not followed by end of comment.
     
    687687
    688688        $html_regex =            // Needs replaced with wp_html_split() per Shortcode API Roadmap.
    689               '<'                // Find start of element.
     689            '<'                // Find start of element.
    690690            . '(?(?=!--)'        // Is this a comment?
    691691            .     $comment_regex // Find end of comment.
     
    719719    $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex().
    720720    $regex =
    721           '\['              // Find start of shortcode.
     721        '\['              // Find start of shortcode.
    722722        . '[\/\[]?'         // Shortcodes may begin with [/ or [[
    723723        . $tagregexp        // Only match registered shortcodes, because performance.
     
    819819
    820820    $pattern =
    821           '/'
     821        '/'
    822822        . '<p>'                              // Opening paragraph
    823823        . '(?:' . $spaces . ')*+'            // Optional leading whitespace
     
    27522752
    27532753    if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
    2754          preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
    2755     ) {
     2754        preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) ) {
     2755
    27562756        return "<a $text>";
    27572757    }
Note: See TracChangeset for help on using the changeset viewer.