Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/16/2025 01:59:56 PM (8 months ago)
Author:
espellcaste
Message:

seems_utf8 is deprecated in WordPress 6.9, let us use its replacement, wp_is_valid_utf8, instead.

Instances where seems_utf8 was used were updated to use wp_is_valid_utf8 instead,
if available (WordPress 6.9).

Props espellcaste.

Closes https://github.com/buddypress/buddypress/pull/424/
See #9309 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-attachment.php

    r13901 r14145  
    297297        public function sanitize_utf8_filename( $retval ) {
    298298                // PHP 5.4+ or with PECL intl 2.0+ .
    299                 if ( function_exists( 'transliterator_transliterate' ) && seems_utf8( $retval ) ) {
     299                if (
     300                        function_exists( 'transliterator_transliterate' )
     301                        // wp_is_valid_utf8 is added in WP 6.9.
     302                        && function_exists( 'wp_is_valid_utf8' ) ? wp_is_valid_utf8( $retval ) : seems_utf8( $retval )
     303                ) {
    300304                        $retval = transliterator_transliterate( 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove', $retval );
    301305
     
    306310
    307311                        // Still here? use iconv().
    308                         if ( function_exists( 'iconv' ) && seems_utf8( $retval ) ) {
     312                        if (
     313                                function_exists( 'iconv' )
     314                                // wp_is_valid_utf8 is added in WP 6.9.
     315                                && function_exists( 'wp_is_valid_utf8' ) ? wp_is_valid_utf8( $retval ) : seems_utf8( $retval )
     316                        ) {
    309317                                $retval = iconv( 'UTF-8', 'ASCII//TRANSLIT//IGNORE', $retval );
    310318                        }
Note: See TracChangeset for help on using the changeset viewer.