Ticket #6969: 6969.diff
| File 6969.diff, 1.3 KB (added by , 17 years ago) |
|---|
-
wp-includes/formatting.php
32 32 $has_pre_parent = false; 33 33 $output = ''; 34 34 $curl = ''; 35 $textarr = preg_split('/( <.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);35 $textarr = preg_split('/([<\[].*[>\]]|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); 36 36 $stop = count($textarr); 37 37 38 38 // if a plugin has provided an autocorrect array, use it … … 50 50 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); 51 51 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); 52 52 53 $shortcodes = array_keys($GLOBALS['shortcode_tags']); 54 $shortcoderegex = '/^\[' . implode('|', array_map('preg_quote', $shortcodes) ) . '/i'; 55 53 56 for ( $i = 0; $i < $stop; $i++ ) { 54 57 $curl = $textarr[$i]; 55 58 … … 64 67 $has_pre_parent = true; 65 68 } elseif (strpos($curl, '</pre>') !== false) { 66 69 $has_pre_parent = false; 70 } elseif ( preg_match($shortcoderegex, $curl) ) { 71 $next = false; 67 72 } else { 68 73 $next = true; 69 74 }