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
This commit is contained in:
Gary Pendergast 2016-05-20 04:54:27 +00:00
parent 9fa38fdc31
commit 7349a7a60e
2 changed files with 5 additions and 1 deletions

View File

@ -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 {

View File

@ -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.