#46143 closed defect (bug) (worksforme)
UTF8 typo, but
| Reported by: | masterross | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Charset | Version: | 5.0.3 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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 semi colon. You will need to find where this is set (aphp.inifile or anini_setcall fordefault_charsetdirective) and remove the semicolon.