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:
parent
9369d03bc5
commit
3945ee3f86
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue