Skip to content

Commit

Permalink
Stop using utf8_encode to avoid deprecation warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Dec 14, 2023
1 parent e833112 commit aae5ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Helpers/device_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function audit_convert(string $input)
// See if we have stringified JSON
$json = html_entity_decode($input);
if (mb_detect_encoding($json) !== 'UTF-8') {
$json = utf8_encode($json);
$json = mb_convert_encoding($json, 'UTF-8', mb_list_encodings());
}
$json = @json_decode($json);
if ($json) {
Expand Down Expand Up @@ -84,7 +84,7 @@ function audit_convert(string $input)
}
$xml = html_entity_decode($input);
if (mb_detect_encoding($xml) !== 'UTF-8') {
$xml = utf8_encode($xml);
$xml = mb_convert_encoding($xml, 'UTF-8', mb_list_encodings());
}
$xml = iconv('UTF-8', 'UTF-8//TRANSLIT', $xml);
$xml = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/u', '', $xml);
Expand Down

0 comments on commit aae5ae8

Please sign in to comment.