#46143 closed defect (bug) (worksforme)
UTF8 typo, but
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.0.3 |
Component: | Charset | Keywords: | |
Focuses: | Cc: |
Description
Hi,
It looks like there is a typo (bug) in function wp_encode_emoji()
in line 5125 on /wp-includes/formatting.php :
<?php function wp_encode_emoji( $content ) { $emoji = _wp_emoji_list( 'partials' ); foreach ( $emoji as $emojum ) { if ( version_compare( phpversion(), '5.4', '<' ) ) { $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' ); } else { $emoji_char = html_entity_decode( $emojum ); } if ( false !== strpos( $content, $emoji_char ) ) { $content = preg_replace( "/$emoji_char/", $emojum, $content ); } } return $content; }
'<' should be '>'
I found it when I check our error log filled with:
UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125 [29-Jan-2019 16:05:16 UTC] PHP Warning: html_entity_decode(): charset `UTF-8;’ not supported, assuming utf-8 in /home/ladylen/public_html/blog/wp-includes/formatting.php on line 5125
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hello @masterross - Welcome to WordPress Trac!
Current approach is correct. Prior to PHP 5.4, the default encoding was
ISO-8859-1
(yuck!), so this workaround was needed.Looking at the error message, it looks like you have an error in your php.ini settings:
UTF-8;’
. Notice the unnecessary semicolon. You will need to find where this is set (aphp.ini
file or anini_set
call fordefault_charset
directive) and remove the semicolon.