From 4f017fcdc3485a39ccd2eeea29753bffcc3517ef Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 10 Jun 2025 13:53:44 +0800 Subject: [PATCH] fix 2 --- application/controllers/cache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 447202f8..eb5b1201 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -39,6 +39,8 @@ class Cache extends CI_Controller { * */ public function update() { + header('Content-Type: text/html; charset=utf-8'); + $returnType = $this->input->get('type'); //设置缓存文件文件夹 $cache_config = $this->config->item('cache'); @@ -156,9 +158,9 @@ class Cache extends CI_Controller { $url_temp = str_replace('/index.htm', '/', $url_temp); $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); - // $encode = mb_detect_encoding($url_temp, ['ASCII', 'GBK', 'ISO-8859-1', 'UTF-8']); + $encode = mb_detect_encoding($url_temp, ['ASCII', 'GBK', 'ISO-8859-1', 'UTF-8']); // $_url_temp = mb_convert_encoding($url_temp, 'UTF8', $encode); - $_url_temp = $url_temp; + $_url_temp = mb_convert_encoding($url_temp, 'UTF-8', 'GBK') . '?encoding=' . $encode; $file[] = $_url_temp; }