Make WordPress Core


Ignore:
Timestamp:
06/10/2014 02:02:23 AM (10 years ago)
Author:
wonderboymusic
Message:

smilies_init(), treat   like whitespace when converting smilies.

Adds unit tests.

Props miqrogroove.
Fixes #27587.

File:
1 edited

Legend:

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

    r28712 r28717  
    27142714    krsort($wpsmiliestrans);
    27152715
    2716     $wp_smiliessearch = '/((?:\s|^)';
     2716    $spaces = wp_spaces_regexp();
     2717
     2718    // Begin first "subpattern"
     2719    $wp_smiliessearch = '/(?<=' . $spaces . '|^)';
    27172720
    27182721    $subchar = '';
     
    27242727        if ($firstchar != $subchar) {
    27252728            if ($subchar != '') {
    2726                 $wp_smiliessearch .= ')(?=\s|$))|((?:\s|^)'; ;
     2729                $wp_smiliessearch .= ')(?=' . $spaces . '|$)';  // End previous "subpattern"
     2730                $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern"
    27272731            }
    27282732            $subchar = $firstchar;
     
    27342738    }
    27352739
    2736     $wp_smiliessearch .= ')(?=\s|$))/m';
     2740    $wp_smiliessearch .= ')(?=' . $spaces . '|$)/m';
    27372741
    27382742}
Note: See TracChangeset for help on using the changeset viewer.