Changeset 30455 for branches/3.8
- Timestamp:
- 11/20/2014 02:36:42 PM (10 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- Property svn:mergeinfo changed
/branches/3.9 merged: 30452
- Property svn:mergeinfo changed
-
branches/3.8/src/wp-includes/formatting.php
r26851 r30455 122 122 $no_texturize_shortcodes_stack = array(); 123 123 124 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); 124 // Look for shortcodes and HTML elements. 125 126 $shortcode_regex = 127 '\[' // Find start of shortcode. 128 . '[^\[\]<>]++' // Shortcodes do not contain other shortcodes. Possessive critical. 129 . '\]'; // Find end of shortcode. 130 131 $textarr = preg_split("/(<[^>]*>|$shortcode_regex)/s", $text, -1, PREG_SPLIT_DELIM_CAPTURE); 125 132 126 133 foreach ( $textarr as &$curl ) { … … 132 139 if ( '<' === $first ) { 133 140 _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); 134 } elseif ( '[' === $first ) {141 } elseif ( '[' === $first && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) { 135 142 _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); 136 143 } elseif ( empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack) ) { … … 173 180 array_push($stack, $matches[1]); 174 181 } 182 } elseif ( 0 == count( $stack ) ) { 183 // Stack is empty. Just stop. 175 184 } else { 176 185 // Closing? Check $text+2 against disabled elements
Note: See TracChangeset
for help on using the changeset viewer.