Ticket #16448: 16448.diff
File 16448.diff, 1.3 KB (added by , 14 years ago) |
---|
-
wp-includes/formatting.php
1475 1475 // HTML loop taken from texturize function, could possible be consolidated 1476 1476 $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between 1477 1477 $stop = count($textarr);// loop stuff 1478 1479 $tags_to_ignore = array('code', 'pre'); 1480 $inside_ignore_block = ''; 1481 1478 1482 for ($i = 0; $i < $stop; $i++) { 1479 1483 $content = $textarr[$i]; 1480 if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag 1484 1485 // If we're in an ignore block, wait until we find its closing tag 1486 if( ! $inside_ignore_block && preg_match( '/^<(' . implode( '|', $tags_to_ignore ) . ')>/', $content, $matches ) ) 1487 $inside_ignore_block = $matches[1]; 1488 1489 if ( ! $inside_ignore_block && ( strlen($content) > 0 ) && ( '<' != $content[0] ) ) // If it's not a tag 1481 1490 $content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content); 1482 } 1491 1492 if( $inside_ignore_block && ( '</' . $inside_ignore_block .'>' == $content ) ) 1493 $inside_ignore_block = ''; 1494 1483 1495 $output .= $content; 1484 1496 } 1485 1497 } else {