Make WordPress Core

Ticket #41501: 41501.patch

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

Your solution is good but it is fine if we use this code standard.

  • 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' ) ) {
     5152                if ( mb_check_encoding( $string, 'ASCII' ) ) {
     5153                        return $text
     5154                }
     5155        } elseif ( ! preg_match( '/[^\x00-\x7F]/', $string ) && && false === strpos( '&#x', $text ) ) {
     5156                return $text
     5157        }
    51515158        $text = wp_encode_emoji( $text );
    51525159
    51535160        $output = '';