Use WP remove_accents() instead of iconv
This commit is contained in:
parent
0699022a46
commit
74e94f86d0
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue