From 74e94f86d03e83d6ff2afb2d3364e28400f354a4 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 19 Aug 2020 18:58:45 -0300 Subject: [PATCH] Use WP remove_accents() instead of iconv --- includes/wc-core-functions.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index 5335f6b0987..3e585dd8298 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -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 ); }