From 8104c26b195d5ce83a2a5e2379aa576597d55fd5 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 2 Mar 2022 07:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BB=BB=E5=8A=A1=E7=AE=80?= =?UTF-8?q?=E4=BB=8B=E5=87=BA=E7=8E=B0"=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Module/Base.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Module/Base.php b/app/Module/Base.php index e6e3bd40d..ce48c18f6 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -342,19 +342,15 @@ class Base { if (strtolower($charset) == 'utf-8') { if (Base::getStrlen($string) <= $length) return $string; - $strcut = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); - $strcut = Base::utf8Substr($strcut, $length, $start); - $strcut = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $strcut); + $strcut = Base::utf8Substr($string, $length, $start); return $strcut . $dot; } else { $length = $length * 2; if (strlen($string) <= $length) return $string; - $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string); $strcut = ''; for ($i = 0; $i < $length; $i++) { $strcut .= ord($string[$i]) > 127 ? $string[$i] . $string[++$i] : $string[$i]; } - $strcut = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $strcut); } return $strcut . $dot; }