WordPress.org

Make WordPress Core

Ticket #41501: 41501.2.diff

File 41501.2.diff, 661 bytes (added by pento, 2 years ago)
  • src/wp-includes/formatting.php

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