mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@37469 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -102,4 +102,21 @@ class Tests_Sanitize_Option extends WP_UnitTestCase {
|
||||
$this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket #36122
|
||||
*/
|
||||
public function test_emoji_in_blogname_and_description() {
|
||||
global $wpdb;
|
||||
|
||||
$value = "whee\xf0\x9f\x98\x88";
|
||||
|
||||
if ( 'utf8mb4' === $wpdb->get_col_charset( $wpdb->options, 'option_value' ) ) {
|
||||
$expected = $value;
|
||||
} else {
|
||||
$expected = 'whee😈';
|
||||
}
|
||||
|
||||
$this->assertSame( $expected, sanitize_option( 'blogname', $value ) );
|
||||
$this->assertSame( $expected, sanitize_option( 'blogdescription', $value ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user