Make WordPress Core

Ticket #41501: 41501_4.patch

File 41501_4.patch, 701 bytes (added by umangvaghela123, 7 years ago)

Your solution is good but it is strpos() condition is wrong.

  • formatting.php

     
    51475147 * @param string $text The content to encode.
    51485148 * @return string The encoded content.
    51495149 */
    5150 function wp_staticize_emoji( $text ) {
     5150function wp_staticize_emoji( $text ) {
     5151        if ( ( ( function_exists( 'mb_check_encoding' ) && mb_check_encoding( $text, 'ASCII' ) ) || ! preg_match( '/[^\x00-\x7F]/', $text ) ) && false === strpos( $text ,'&#x' ) ) {
     5152                 // The text doesn't contain anything that might be emoji, so we can return early.
     5153                        return $text;
     5154        }
    51515155        $text = wp_encode_emoji( $text );
    51525156
    51535157        $output = '';