Changeset 37469
- Timestamp:
- 05/20/2016 04:53:40 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/formatting.php (modified) (1 diff)
-
tests/phpunit/tests/option/sanitize-option.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r37431 r37469 3707 3707 case 'blogname': 3708 3708 $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value ); 3709 if ( $value !== $original_value ) { 3710 $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', wp_encode_emoji( $original_value ) ); 3711 } 3712 3709 3713 if ( is_wp_error( $value ) ) { 3710 3714 $error = $value->get_error_message(); -
trunk/tests/phpunit/tests/option/sanitize-option.php
r34519 r37469 103 103 } 104 104 105 /** 106 * @ticket #36122 107 */ 108 public function test_emoji_in_blogname_and_description() { 109 global $wpdb; 110 111 $value = "whee\xf0\x9f\x98\x88"; 112 113 if ( 'utf8mb4' === $wpdb->get_col_charset( $wpdb->options, 'option_value' ) ) { 114 $expected = $value; 115 } else { 116 $expected = 'whee😈'; 117 } 118 119 $this->assertSame( $expected, sanitize_option( 'blogname', $value ) ); 120 $this->assertSame( $expected, sanitize_option( 'blogdescription', $value ) ); 121 } 105 122 }
Note: See TracChangeset
for help on using the changeset viewer.