From 2d56fc1883babd0edc5b43a7ac7dcff7fa7ef1ec Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 14:32:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 15 ++++++++++++--- application/views/cache/update.php | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index a92a435f..8bc7cbde 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -52,6 +52,10 @@ class Cache extends CI_Controller $this->post_para = $current_cache_config['cache_api_para']; //遍历缓存文件夹 $this->tree($this->dir, $this->file, $this->path, $this->file_time); + //print_r($this->file); + //print_r($this->path); + //print_r($this->file_time); + //die(); //按目录筛选结果 $this->filter($this->file, $this->path); @@ -147,10 +151,15 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $file_temp = str_ireplace('/index.htm###', '', $f.'###'); - $file_temp = str_ireplace('###', '', $file_temp); - $path_temp = str_ireplace($this->dir, '', $dir); + $encode = mb_detect_encoding($f, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5')); + $_f = mb_convert_encoding ($f, 'UTF-8', 'GBK'); + $_dir = mb_convert_encoding ($dir, 'UTF-8', 'GBK'); + + $file_temp = str_replace('/index.htm###', '', $_f.'###'); + $file_temp = str_replace('###', '', $file_temp); + $path_temp = str_replace($this->dir, '', $_dir); $url_temp = $this->current_domain.$path_temp.'/'.$file_temp; + $url_temp = str_replace('index.htm', '', $url_temp); $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); $file[] = $url_temp; } diff --git a/application/views/cache/update.php b/application/views/cache/update.php index 61595611..ca6a6603 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -2,7 +2,7 @@