From 1664181a63a9592afbde9b664762c0f599330727 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 22 Jan 2019 15:26:40 +0200 Subject: [PATCH] Wrap iconv usage in function_exists for compatibility. --- includes/wc-core-functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index a9ba7f04ccd..06f4e589bb6 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -1561,8 +1561,10 @@ function wc_uasort_comparison( $a, $b ) { * @return int */ function wc_ascii_uasort_comparison( $a, $b ) { - $aconv = iconv( 'UTF-8', 'ASCII//TRANSLIT', $a ); - $bconv = iconv( 'UTF-8', 'ASCII//TRANSLIT', $b ); + if ( function_exists( 'iconv' ) ) { + $a = iconv( 'UTF-8', 'ASCII//TRANSLIT', $a ); + $b = iconv( 'UTF-8', 'ASCII//TRANSLIT', $b ); + } return strcmp( $aconv, $bconv ); }