WordPress.org

Make WordPress Core

Changeset 27844


Ignore:
Timestamp:
03/29/2014 08:59:38 AM (7 years ago)
Author:
nacin
Message:

Add braces to wptexturize() after [27839]. see #22692.

File:
1 edited

Legend:

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

    r27839 r27844  
    8888
    8989        // '99 '99s '99's (apostrophe)
    90         if ( "'" != $apos )
     90        if ( "'" !== $apos ) {
    9191            $dynamic[ '/\'(?=\d)/' ] = $apos;
     92        }
    9293
    9394        // Single quote at start, or preceded by (, {, <, [, ", or spaces.
    94         if ( "'" != $opening_single_quote )
     95        if ( "'" !== $opening_single_quote ) {
    9596            $dynamic[ '/(?<=\A|[([{<"]|' . $spaces . ')\'/' ] = $opening_single_quote;
     97        }
    9698
    9799        // 9" (double prime)
    98         if ( '"' != $double_prime )
     100        if ( '"' !== $double_prime ) {
    99101            $dynamic[ '/(?<=\d)"/' ] = $double_prime;
     102        }
    100103
    101104        // 9' (prime)
    102         if ( "'" != $prime )
     105        if ( "'" !== $prime ) {
    103106            $dynamic[ '/(?<=\d)\'/' ] = $prime;
     107        }
    104108
    105109        // Apostrophe in a word.  No spaces or double primes.
    106         if ( "'" != $apos )
     110        if ( "'" !== $apos ) {
    107111            $dynamic[ '/(?<!' . $spaces . ')\'(?!\'|' . $spaces . ')/' ] = $apos;
     112        }
    108113
    109114        // Double quote at start, or preceded by (, {, <, [, or spaces, and not followed by spaces.
    110         if ( '"' != $opening_quote )
     115        if ( '"' !== $opening_quote ) {
    111116            $dynamic[ '/(?<=\A|[([{<]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
     117        }
    112118
    113119        // Any remaining double quotes.
    114         if ( '"' != $closing_quote )
     120        if ( '"' !== $closing_quote ) {
    115121            $dynamic[ '/"/' ] = $closing_quote;
     122        }
    116123
    117124        // Single quotes followed by spaces or a period.
    118         if ( "'" != $closing_single_quote )
    119             $dynamic[ '/\'(?=\Z|\.|' . $spaces . ')/' ] = $closing_single_quote;
     125        if ( "'" !== $closing_single_quote ) {
     126            $dynamic[ '/\'(?=\Z|\.|' . $spaces . ')/' ] = $closing_single_quote;
     127        }
    120128
    121129        $dynamic_characters = array_keys( $dynamic );
     
    148156
    149157    foreach ( $textarr as &$curl ) {
    150         if ( empty( $curl ) )
     158        if ( empty( $curl ) ) {
    151159            continue;
     160        }
    152161
    153162        // Only call _wptexturize_pushpop_element if first char is correct tag opening
     
    213222
    214223            // Make sure it matches the opening tag
    215             if ($last != $matches[1])
    216                 array_push($stack, $last);
     224            if ( $last != $matches[1] ) {
     225                array_push( $stack, $last );
     226            }
    217227        }
    218228    }
Note: See TracChangeset for help on using the changeset viewer.