WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/14/2017 11:49:34 AM (3 years ago)
Author:
pento
Message:

Emoji: Fix some failing unit tests in PHP 5.2 and 5.3.

  • Older versions of PHP don't know how to html_entity_decode() emoji.
  • The fall back regex was a little too broad, catching characters that aren't emoji.

See #35293.

File:
1 edited

Legend:

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

    r41043 r41045  
    52915291    if ( 'codepoints' === $type && ( ! defined( 'PCRE_VERSION' ) || version_compare( PCRE_VERSION, '8.32', '<=' ) ) ) {
    52925292        return '/(
    5293              \xE2\x98[\x80-\xFF]            # Symbols
    5294            | \xE2\x99[\x00-\xFF]
    5295            | [\xE3-\xED][\x00-\xFF]{2}
     5293             \xE2\x99[\x80-\x82]            # Male and female symbols
    52965294           | [\x23\x30-\x39]\xE2\x83\xA3    # Digits
    52975295           | \xF0\x9F[\x85-\x88][\xA6-\xBF] # Enclosed characters
Note: See TracChangeset for help on using the changeset viewer.