From da224558cc50efc133d394c94556828f64884c24 Mon Sep 17 00:00:00 2001 From: io-developer Date: Fri, 20 Jan 2023 21:35:31 +0000 Subject: [PATCH] fix strict typing fatal --- src/Iodev/Whois/Helpers/TextHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Iodev/Whois/Helpers/TextHelper.php b/src/Iodev/Whois/Helpers/TextHelper.php index d998ecc4..be96554a 100644 --- a/src/Iodev/Whois/Helpers/TextHelper.php +++ b/src/Iodev/Whois/Helpers/TextHelper.php @@ -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;