Changeset 30456
- Timestamp:
- 11/20/2014 02:39:12 PM (10 years ago)
- Location:
- branches/3.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/branches/3.9 merged: 30452
- Property svn:mergeinfo changed
-
branches/3.7/src/wp-includes/formatting.php
r25695 r30456 108 108 $no_texturize_shortcodes_stack = array(); 109 109 110 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); 110 // Look for shortcodes and HTML elements. 111 112 $shortcode_regex = 113 '\[' // Find start of shortcode. 114 . '[^\[\]<>]++' // Shortcodes do not contain other shortcodes. Possessive critical. 115 . '\]'; // Find end of shortcode. 116 117 $textarr = preg_split("/(<[^>]*>|$shortcode_regex)/s", $text, -1, PREG_SPLIT_DELIM_CAPTURE); 111 118 112 119 foreach ( $textarr as &$curl ) { … … 118 125 if ( '<' === $first ) { 119 126 _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); 120 } elseif ( '[' === $first ) {127 } elseif ( '[' === $first && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) { 121 128 _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); 122 129 } elseif ( empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack) ) { … … 159 166 array_push($stack, $matches[1]); 160 167 } 168 } elseif ( 0 == count( $stack ) ) { 169 // Stack is empty. Just stop. 161 170 } else { 162 171 // Closing? Check $text+2 against disabled elements
Note: See TracChangeset
for help on using the changeset viewer.