Exclude a newline between delimeters from further checks in wptexturize() for better performance.
props miqrogroove. fixes #28724. git-svn-id: https://develop.svn.wordpress.org/trunk@29008 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a6ff9013be
commit
b3695a587f
|
@ -234,6 +234,11 @@ function wptexturize($text, $reset = false) {
|
|||
_wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags );
|
||||
}
|
||||
|
||||
} elseif ( '' === trim( $curl ) ) {
|
||||
// This is a newline between delimeters. Performance improves when we check this.
|
||||
|
||||
continue;
|
||||
|
||||
} elseif ( '[' === $first && 1 === preg_match( '/^\[(?:[^\[\]<>]|<[^>]+>)+\]$/', $curl ) ) {
|
||||
// This is a shortcode delimeter.
|
||||
|
||||
|
@ -245,6 +250,8 @@ function wptexturize($text, $reset = false) {
|
|||
// Do not texturize.
|
||||
// Do not push to the shortcodes stack.
|
||||
|
||||
continue;
|
||||
|
||||
} elseif ( empty( $no_texturize_shortcodes_stack ) && empty( $no_texturize_tags_stack ) ) {
|
||||
// This is neither a delimeter, nor is this content inside of no_texturize pairs. Do texturize.
|
||||
|
||||
|
|
Loading…
Reference in New Issue