mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Emoji: When encoding emoji into HTML entities, 0 was being incorrectly trimmed from the right side of the hex string, causing some characters to be encoded incorrectly.
git-svn-id: https://develop.svn.wordpress.org/trunk@31926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4212,7 +4212,7 @@ function wp_encode_emoji( $content ) {
|
||||
*/
|
||||
$unpacked = unpack( 'H*', mb_convert_encoding( $emoji, 'UTF-32', 'UTF-8' ) );
|
||||
if ( isset( $unpacked[1] ) ) {
|
||||
$entity = '&#x' . trim( $unpacked[1], '0' ) . ';';
|
||||
$entity = '&#x' . ltrim( $unpacked[1], '0' ) . ';';
|
||||
$content = str_replace( $emoji, $entity, $content );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user