WordPress.org

Make WordPress Core

Ticket #45930: 45930.patch

File 45930.patch, 1.2 KB (added by johnbillion, 11 months ago)
  • src/wp-includes/formatting.php

    diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
    index f858d7b9ab..16bfd18823 100644
    function _print_emoji_detection_script() { 
    54775477 */
    54785478function wp_encode_emoji( $content ) {
    54795479        $emoji = _wp_emoji_list( 'partials' );
     5480        $compat = version_compare( phpversion(), '5.4', '<' );
    54805481
    54815482        foreach ( $emoji as $emojum ) {
    5482                 if ( version_compare( phpversion(), '5.4', '<' ) ) {
     5483                if ( $compat ) {
    54835484                        $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
    54845485                } else {
    54855486                        $emoji_char = html_entity_decode( $emojum );
    function wp_staticize_emoji( $text ) { 
    55195520
    55205521        // Quickly narrow down the list of emoji that might be in the text and need replacing.
    55215522        $possible_emoji = array();
     5523        $compat         = version_compare( phpversion(), '5.4', '<' );
    55225524        foreach ( $emoji as $emojum ) {
    55235525                if ( false !== strpos( $text, $emojum ) ) {
    5524                         if ( version_compare( phpversion(), '5.4', '<' ) ) {
     5526                        if ( $compat ) {
    55255527                                $possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
    55265528                        } else {
    55275529                                $possible_emoji[ $emojum ] = html_entity_decode( $emojum );