Make WordPress Core

Changeset 25338 for trunk/src


Ignore:
Timestamp:
09/11/2013 03:22:09 AM (11 years ago)
Author:
nacin
Message:

Improve clarity and speed of [25320].

File:
1 edited

Legend:

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

    r25333 r25338  
    263263            return false;
    264264    } else {
    265         // ensures ; or } exists but is not in the first X chars
    266         if ( strpos( $data, ';' ) < 3 && strpos( $data, '}' ) < 4 )
     265        $semicolon = strpos( $data, ';' );
     266        $brace     = strpos( $data, '}' );
     267        // Either ; or } must exist.
     268        if ( false === $semicolon && false === $brace )
     269            return false;
     270        // But neither must be in the first X characters.
     271        if ( false !== $semicolon && $semicolon < 3 )
     272            return false;
     273        if ( false !== $brace && $brace < 4 )
    267274            return false;
    268275    }
Note: See TracChangeset for help on using the changeset viewer.