Make WordPress Core


Ignore:
Timestamp:
07/06/2014 08:49:25 AM (12 years ago)
Author:
SergeyBiryukov
Message:

Exclude a newline between delimeters from further checks in wptexturize() for better performance.

props miqrogroove.
fixes #28724.

File:
1 edited

Legend:

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

    r28986 r29008  
    235235                        }
    236236
     237                } elseif ( '' === trim( $curl ) ) {
     238                        // This is a newline between delimeters.  Performance improves when we check this.
     239
     240                        continue;
     241
    237242                } elseif ( '[' === $first && 1 === preg_match( '/^\[(?:[^\[\]<>]|<[^>]+>)+\]$/', $curl ) ) {
    238243                        // This is a shortcode delimeter.
    … …  
    245250                        // Do not texturize.
    246251                        // Do not push to the shortcodes stack.
     252
     253                        continue;
    247254
    248255                } elseif ( empty( $no_texturize_shortcodes_stack ) && empty( $no_texturize_tags_stack ) ) {
Note: See TracChangeset for help on using the changeset viewer.