WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2013 02:45:39 AM (8 years ago)
Author:
wonderboymusic
Message:

Don't place smilies inside of pre or code tags. Don't skip smilie after a smilie with an 8 in it. Fix regular expression used for smiley translations to work when there is only one registered emoticon.

Props solarissmoke, soulseekah, mdbitz, yonasy. ht to mdbitz for the Unit Tests and a comprehensive patch.
Fixes #16448, #20124, #25303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r26031 r26191  
    24782478}
    24792479
     2480
    24802481/**
    24812482 * Convert smiley code to the icon graphic file equivalent.
     
    25672568    krsort($wpsmiliestrans);
    25682569
    2569     $wp_smiliessearch = '/(?:\s|^)';
     2570    $wp_smiliessearch = '/((?:\s|^)';
    25702571
    25712572    $subchar = '';
     
    25772578        if ($firstchar != $subchar) {
    25782579            if ($subchar != '') {
    2579                 $wp_smiliessearch .= ')|(?:\s|^)';
     2580                $wp_smiliessearch .= ')(?=\s|$))|((?:\s|^)'; ;
    25802581            }
    25812582            $subchar = $firstchar;
     
    25872588    }
    25882589
    2589     $wp_smiliessearch .= ')(?:\s|$)/m';
     2590    $wp_smiliessearch .= ')(?=\s|$))/m';
     2591
    25902592}
    25912593
Note: See TracChangeset for help on using the changeset viewer.