Skip to content

Commit

Permalink
fix strict typing fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
io-developer committed Jan 20, 2023
1 parent 5ec4fd7 commit da22455
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Iodev/Whois/Helpers/TextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class TextHelper
*/
public static function toUtf8($text)
{
$srcEncoding = strtolower(mb_detect_encoding($text));
if (!empty($srcEncoding) && $srcEncoding !== 'utf-8') {
return mb_convert_encoding($text, 'utf-8', $srcEncoding);
$srcEncoding = mb_detect_encoding($text);
if (!empty($srcEncoding) && strtolower($srcEncoding) !== 'utf-8') {
return mb_convert_encoding($text, 'utf-8', strtolower($srcEncoding));
}
if (mb_check_encoding($text, 'utf-8')) {
return $text;
Expand Down

0 comments on commit da22455

Please sign in to comment.