Skip to content
Snippets Groups Projects

Fixed PHP 8.2 Compatiblilty.

Merged Shivam Tiwari requested to merge issue/easychart-3509732:3509732-php-8-2-compatiblilty into 4.x
1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
+ 4
2
@@ -2,6 +2,8 @@
namespace Drupal\easychart;
use Drupal\Component\Utility\Unicode;
/**
* Update helper class.
*/
@@ -63,7 +65,7 @@ class EasychartUpdate {
$enc = preg_replace_callback(
'/"(.*?)"/s',
function ($field) {
return urlencode(utf8_encode($field[1]));
return urlencode(Unicode::convertToUtf8($field[1], 'ISO-8859-1'));
},
$enc
);
@@ -73,7 +75,7 @@ class EasychartUpdate {
$fields = $trim_fields ? array_map('trim', explode($delimiter, $line)) : explode($delimiter, $line);
return array_map(
function ($field) {
return str_replace('!!Q!!', '"', utf8_decode(urldecode($field)));
return str_replace('!!Q!!', '"', Unicode::convertFromUtf8(urldecode($field), 'ISO-8859-1'));
},
$fields
);
Loading