Use WP remove_accents() instead of iconv

This commit is contained in:
Claudio Sanches 2020-08-19 18:58:45 -03:00
parent 0699022a46
commit 74e94f86d0
1 changed files with 3 additions and 6 deletions

View File

@ -1752,12 +1752,9 @@ function wc_uasort_comparison( $a, $b ) {
* @return int
*/
function wc_ascii_uasort_comparison( $a, $b ) {
// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
if ( function_exists( 'iconv' ) && defined( 'ICONV_IMPL' ) && @strcasecmp( ICONV_IMPL, 'unknown' ) !== 0 ) {
$a = @iconv( 'UTF-8', 'ASCII//TRANSLIT//IGNORE', $a );
$b = @iconv( 'UTF-8', 'ASCII//TRANSLIT//IGNORE', $b );
}
// phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged
$a = remove_accents( html_entity_decode( $a ) );
$b = remove_accents( html_entity_decode( $b ) );
return strcmp( $a, $b );
}