Make WordPress Core

Ticket #24661: normalize_before_removing_accents.patch

File normalize_before_removing_accents.patch, 486 bytes (added by rodrigosevero, 3 years ago)

Patch to solve expanded characters not being substituted using PHP's own normalizer_normalize function.

  • wp-includes/formatting.php

    old new  
    15881588        }
    15891589
    15901590        if ( seems_utf8( $string ) ) {
     1591                if ( function_exists( 'normalizer_normalize' ) ) {
     1592                        if ( ! normalizer_is_normalized( $string, Normalizer::FORM_C ) ) {
     1593                                $string = normalizer_normalize( $string, Normalizer::FORM_C );
     1594                        }
     1595                }
    15911596                $chars = array(
    15921597                        // Decompositions for Latin-1 Supplement.
    15931598                        'ª' => 'a',