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

Props jrf.
Fixes #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46214 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-09-20 22:01:36 +00:00
parent 92d70ed696
commit 099adc0243
16 changed files with 9 additions and 104 deletions

View File

@@ -5572,15 +5572,10 @@ function _print_emoji_detection_script() {
* @return string The encoded content.
*/
function wp_encode_emoji( $content ) {
$emoji = _wp_emoji_list( 'partials' );
$compat = version_compare( phpversion(), '5.4', '<' );
$emoji = _wp_emoji_list( 'partials' );
foreach ( $emoji as $emojum ) {
if ( $compat ) {
$emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
} else {
$emoji_char = html_entity_decode( $emojum );
}
$emoji_char = html_entity_decode( $emojum );
if ( false !== strpos( $content, $emoji_char ) ) {
$content = preg_replace( "/$emoji_char/", $emojum, $content );
}
@@ -5616,14 +5611,9 @@ function wp_staticize_emoji( $text ) {
// Quickly narrow down the list of emoji that might be in the text and need replacing.
$possible_emoji = array();
$compat = version_compare( phpversion(), '5.4', '<' );
foreach ( $emoji as $emojum ) {
if ( false !== strpos( $text, $emojum ) ) {
if ( $compat ) {
$possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
} else {
$possible_emoji[ $emojum ] = html_entity_decode( $emojum );
}
$possible_emoji[ $emojum ] = html_entity_decode( $emojum );
}
}