Skip to content
Snippets Groups Projects

Fix php8.2 issue related to deprecated function utf8_decode

1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
@@ -113,7 +113,8 @@ function template_preprocess_views_data_export_csv_header(&$vars) {
if (!empty($vars['options']['encoding']) && function_exists('iconv')) {
switch($vars['options']['encoding']) {
case 'utf8_decode':
$converted = utf8_decode($output);
$converted = function_exists('mb_convert_encoding') ?
mb_convert_encoding($output, 'ISO-8859-1', 'UTF-8') : $output;
break;
default:
$converted = iconv("UTF-8", $vars['options']['encoding'], $output);
@@ -160,7 +161,8 @@ function template_preprocess_views_data_export_csv_body(&$vars) {
if (!empty($vars['options']['encoding']) && function_exists('iconv')) {
switch($vars['options']['encoding']) {
case 'utf8_decode':
$converted = utf8_decode($output);
$converted = function_exists('mb_convert_encoding') ?
mb_convert_encoding($output, 'ISO-8859-1', 'UTF-8') : $output;
break;
default:
$converted = iconv("UTF-8", $vars['options']['encoding'], $output);
Loading