From bd5eecc3c6c3313da190dc8b779f49ffa8d17d4f Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 28 May 2024 14:17:10 +0800 Subject: [PATCH] fix test --- application/controllers/infofix.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index cbee836f..2e097212 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -56,7 +56,9 @@ class infofix extends CI_Controller $sub_content = array(); while ($pos_content) { $_str = '[...' . mb_substr($info->ic_content, $pos_content - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - array_push($sub_content, str_replace($key,'@@@'.$key.'@@@',$_str)); + $_str = str_replace($key,'@@@'.$key.'@@@',$_str); + $_str = explode('@@@',$_str); + array_push($sub_content, $_str); $pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key)); } @@ -68,7 +70,9 @@ class infofix extends CI_Controller $pos_content2 = mb_stripos($info->amp_json, $key); while ($pos_content2) { $_str = '[...' . mb_substr($info->amp_json, $pos_content2 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - array_push($sub_content2, str_replace($key,'@@@'.$key.'@@@',$_str)); + $_str = str_replace($key,'@@@'.$key.'@@@',$_str); + $_str = explode('@@@',$_str); + array_push($sub_content2, $_str); $pos_content2 = mb_stripos($info->amp_json, $key, $pos_content2 + mb_strlen($key)); } } @@ -80,7 +84,9 @@ class infofix extends CI_Controller $pos_content3 = mb_stripos($info->amp_body, $key); while ($pos_content3) { $_str = '[...' . mb_substr($info->amp_body, $pos_content3 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; - array_push($sub_content3, str_replace($key,'@@@'.$key.'@@@',$_str)); + $_str = str_replace($key,'@@@'.$key.'@@@',$_str); + $_str = explode('@@@',$_str); + array_push($sub_content3, $_str); $pos_content3 = mb_stripos($info->amp_body, $key, $pos_content3 + mb_strlen($key)); } }