WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2019 10:01:36 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove all code using a version_compare() with a PHP version older than PHP 5.6.

Props jrf.
Fixes #48074.

File:
1 edited

Legend:

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

    r46164 r46214  
    55735573 */
    55745574function wp_encode_emoji( $content ) {
    5575     $emoji  = _wp_emoji_list( 'partials' );
    5576     $compat = version_compare( phpversion(), '5.4', '<' );
     5575    $emoji = _wp_emoji_list( 'partials' );
    55775576
    55785577    foreach ( $emoji as $emojum ) {
    5579         if ( $compat ) {
    5580             $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
    5581         } else {
    5582             $emoji_char = html_entity_decode( $emojum );
    5583         }
     5578        $emoji_char = html_entity_decode( $emojum );
    55845579        if ( false !== strpos( $content, $emoji_char ) ) {
    55855580            $content = preg_replace( "/$emoji_char/", $emojum, $content );
     
    56175612    // Quickly narrow down the list of emoji that might be in the text and need replacing.
    56185613    $possible_emoji = array();
    5619     $compat         = version_compare( phpversion(), '5.4', '<' );
    56205614    foreach ( $emoji as $emojum ) {
    56215615        if ( false !== strpos( $text, $emojum ) ) {
    5622             if ( $compat ) {
    5623                 $possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
    5624             } else {
    5625                 $possible_emoji[ $emojum ] = html_entity_decode( $emojum );
    5626             }
     5616            $possible_emoji[ $emojum ] = html_entity_decode( $emojum );
    56275617        }
    56285618    }
Note: See TracChangeset for help on using the changeset viewer.