From 7349a7a60ecd1eba889a9d24e717f17ecfa866c9 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 20 May 2016 04:54:27 +0000 Subject: [PATCH] Emoji: Allow emoji in `blogname` and `blogdescription` on `utf8` installs. When the options table is set to `utf8` instead of `utf8mb4`, emoji will be stripped from the blog name and description when they're saved. Instead of stripping them, they can be encode as HTML entities. Fixes #36122. Built from https://develop.svn.wordpress.org/trunk@37469 git-svn-id: http://core.svn.wordpress.org/trunk@37437 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 27ac8db3cb..5819ef479e 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3706,6 +3706,10 @@ function sanitize_option( $option, $value ) { case 'blogdescription': case 'blogname': $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value ); + if ( $value !== $original_value ) { + $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', wp_encode_emoji( $original_value ) ); + } + if ( is_wp_error( $value ) ) { $error = $value->get_error_message(); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 39f655e08e..fa17f04cd7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37468'; +$wp_version = '4.6-alpha-37469'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.