Make WordPress Core


Ignore:
Timestamp:
10/12/2006 10:14:14 AM (19 years ago)
Author:
markjaquith
Message:

Somewhat stricter smilies replacements by Nazgul. fixes #3222

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r4360 r4380  
    619619        // HTML loop taken from texturize function, could possible be consolidated
    620620        $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
    621         $output = implode('', preg_replace($wp_smiliessearch, $wp_smiliesreplace, $textarr));
     621        $stop = count($textarr);// loop stuff
     622        for ($i = 0; $i < $stop; $i++) {
     623            $content = $textarr[$i];
     624            if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
     625                $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
     626            }
     627            $output .= $content;
     628        }
    622629    } else {
    623630        // return default text.
Note: See TracChangeset for help on using the changeset viewer.