Make WordPress Core

Changeset 31772


Ignore:
Timestamp:
03/13/2015 08:26:39 PM (9 years ago)
Author:
azaozz
Message:

Emoji: better regex when testing for only char emoji. Props iseulde. See #31242.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-emoji.js

    r31756 r31772  
    103103
    104104            /*
    105              * Chrome OS X added native emoji rendering in M41. Unfortunately,
     105             * Chrome on OS X added native emoji rendering in M41. Unfortunately,
    106106             * it doesn't work when the font is bolder than 500 weight. So, we
    107107             * check for bold rendering support to avoid invisible emoji in Chrome.
     
    175175                    }
    176176
    177                     if ( emoji.parseFlags && ! emoji.parseAllEmoji && ! icon.match( /^1f1(e[6-9a-f]|f[1-9a-f])-1f1(e[6-9a-f]|f[1-9a-f])$/ ) ) {
     177                    if ( emoji.parseFlags && ! emoji.parseAllEmoji &&
     178                        ! /^1f1(?:e[6-9a-f]|f[1-9a-f])-1f1(?:e[6-9a-f]|f[1-9a-f])$/.test( icon ) ) {
     179
    178180                        return false;
    179181                    }
Note: See TracChangeset for help on using the changeset viewer.