Ticket #8553: 8553.diff
File 8553.diff, 1.1 KB (added by , 11 years ago) |
---|
-
Users/denis/Sites/sem-pro/wp-includes/shortcodes.php
162 162 * 163 163 * @return string The shortcode search regular expression 164 164 */ 165 function get_shortcode_regex( ) {165 function get_shortcode_regex($backtrace = false) { 166 166 global $shortcode_tags; 167 167 $tagnames = array_keys($shortcode_tags); 168 168 $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); 169 170 return '\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\1\])?'; 169 170 if ( $backtrace ) { 171 return '\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\1\])?'; 172 } else { 173 return '\[('.$tagregexp.')\b(?:.*?)?\](?:.+?\[\/\1\])?'; 174 } 171 175 } 172 176 173 177 /** … … 182 186 */ 183 187 function do_shortcode_tag($m) { 184 188 global $shortcode_tags; 185 189 190 static $pattern; 191 192 if ( !isset($pattern) ) 193 $pattern = get_shortcode_regex(true); 194 195 preg_match('/' . $pattern . '/s', $m[0], $m); 196 186 197 $tag = $m[1]; 187 198 $attr = shortcode_parse_atts($m[2]); 188 199