Make WordPress Core

Changeset 61110


Ignore:
Timestamp:
11/01/2025 03:32:57 AM (6 weeks ago)
Author:
westonruter
Message:

Emoji: Convert emoji to HTML entities for utf8mb3 columns during wp_insert_post().

The utf8 character set is a deprecated alias of utf8mb3, but only the former was accounted for.

Follow-up to [31733].

Props kasparsd, mikefitzman, dmsnell, salzano, sabernhardt, ankit-k-gupta, nataliat2004, josklever, slaFFik, staurand.
See #31242, #21212.
Fixes #60362.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r61078 r61110  
    48434843            $charset = $wpdb->get_col_charset( $wpdb->posts, $emoji_field );
    48444844
    4845             if ( 'utf8' === $charset ) {
     4845            // The 'utf8' character set is a deprecated alias of 'utf8mb3'. See <https://dev.mysql.com/doc/refman/8.4/en/charset-unicode-utf8.html>.
     4846            if ( 'utf8' === $charset || 'utf8mb3' === $charset ) {
    48464847                $data[ $emoji_field ] = wp_encode_emoji( $data[ $emoji_field ] );
    48474848            }
Note: See TracChangeset for help on using the changeset viewer.