Wrap iconv usage in function_exists for compatibility.

This commit is contained in:
Gerhard 2019-01-22 15:26:40 +02:00
parent c24faa8ab4
commit 1664181a63
1 changed files with 4 additions and 2 deletions

View File

@ -1561,8 +1561,10 @@ function wc_uasort_comparison( $a, $b ) {
* @return int * @return int
*/ */
function wc_ascii_uasort_comparison( $a, $b ) { function wc_ascii_uasort_comparison( $a, $b ) {
$aconv = iconv( 'UTF-8', 'ASCII//TRANSLIT', $a ); if ( function_exists( 'iconv' ) ) {
$bconv = iconv( 'UTF-8', 'ASCII//TRANSLIT', $b ); $a = iconv( 'UTF-8', 'ASCII//TRANSLIT', $a );
$b = iconv( 'UTF-8', 'ASCII//TRANSLIT', $b );
}
return strcmp( $aconv, $bconv ); return strcmp( $aconv, $bconv );
} }