From 3ddbef69e37d1c08d3a3f45d38ba2d1b3adaed14 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 30 Mar 2015 03:27:31 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@31926 git-svn-id: http://core.svn.wordpress.org/trunk@31905 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 9386be5e52..0f6fc558dd 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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 ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5d1f33e242..18ad39d777 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta3-31925'; +$wp_version = '4.2-beta3-31926'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.