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 01/11] =?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 @@ 更新静态页-v1.0a - + From 50529d7e2aaaecec72c76b870b22dc8df126fe64 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 14:33:21 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 8bc7cbde..fe4522a1 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,7 +151,7 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode = mb_detect_encoding($f, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5')); + $encode = mb_detect_encoding($f, array("Western","ASCII",'UTF-8',"GB2312","GBK",'BIG5')); $_f = mb_convert_encoding ($f, 'UTF-8', 'GBK'); $_dir = mb_convert_encoding ($dir, 'UTF-8', 'GBK'); From 711e9aae194644d793560dd54d17247e2d6a54c5 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 14:35:50 +0800 Subject: [PATCH 03/11] +2 --- application/controllers/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index fe4522a1..8bc7cbde 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,7 +151,7 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode = mb_detect_encoding($f, array("Western","ASCII",'UTF-8',"GB2312","GBK",'BIG5')); + $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'); From bdab4b7f03e32c5440465f01d0a3777298c986b1 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:04:16 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 8bc7cbde..21462e41 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,9 +151,11 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $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'); + $encode_f = mb_detect_encoding($f, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_f = mb_convert_encoding ($f, 'UTF-8', $encode_f); + $encode_d = mb_detect_encoding($dir, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_dir = mb_convert_encoding ($dir, 'UTF-8', $encode_d); + echo($encode_f.'@@@'.$encode_d); $file_temp = str_replace('/index.htm###', '', $_f.'###'); $file_temp = str_replace('###', '', $file_temp); From 0ffbd05e0042ef2e9f093133ac3f3a61d2d34323 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:07:38 +0800 Subject: [PATCH 05/11] +2 --- application/controllers/cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 21462e41..6cc027ca 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,9 +151,9 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode_f = mb_detect_encoding($f, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $encode_f = mb_detect_encoding($f); $_f = mb_convert_encoding ($f, 'UTF-8', $encode_f); - $encode_d = mb_detect_encoding($dir, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $encode_d = mb_detect_encoding($dir); $_dir = mb_convert_encoding ($dir, 'UTF-8', $encode_d); echo($encode_f.'@@@'.$encode_d); From 6c387a30478442ffaafffb413f7fd7360accef10 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:14:55 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E9=87=8D=E7=8E=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 10 ++-------- application/views/cache/update.php | 11 +++++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 6cc027ca..2f7af7dd 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,15 +151,9 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode_f = mb_detect_encoding($f); - $_f = mb_convert_encoding ($f, 'UTF-8', $encode_f); - $encode_d = mb_detect_encoding($dir); - $_dir = mb_convert_encoding ($dir, 'UTF-8', $encode_d); - echo($encode_f.'@@@'.$encode_d); - - $file_temp = str_replace('/index.htm###', '', $_f.'###'); + $file_temp = str_replace('/index.htm###', '', $f.'###'); $file_temp = str_replace('###', '', $file_temp); - $path_temp = str_replace($this->dir, '', $_dir); + $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")); diff --git a/application/views/cache/update.php b/application/views/cache/update.php index ca6a6603..8b68924c 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -124,13 +124,16 @@ $(function() { - $it) { ?> + $it) { + $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_it = mb_convert_encoding($it, 'utf-8', $encode); + ?> - 100) { ?> - .......... + 100) { ?> + .......... - + 无操作 From 63181801ee28e546f3137c679be556d7f68e5594 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:16:06 +0800 Subject: [PATCH 07/11] =?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/views/cache/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index 8b68924c..2f08b0d5 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -126,7 +126,7 @@ $(function() { $it) { $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); - $_it = mb_convert_encoding($it, 'utf-8', $encode); + $_it = mb_convert_encoding($it, 'ASCII', $encode); ?> From 6695ddcd442931a66f15e4c2fcf715ba2a51d9f3 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:17:03 +0800 Subject: [PATCH 08/11] to utf8 --- application/views/cache/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index 2f08b0d5..edf9145d 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -126,7 +126,7 @@ $(function() { $it) { $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); - $_it = mb_convert_encoding($it, 'ASCII', $encode); + $_it = mb_convert_encoding($it, 'UTF-8', $encode); ?> From 59ddce8bc41b6eff4cf64aab36cbdd75ccbc7f08 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:18:01 +0800 Subject: [PATCH 09/11] to utf-8 --- application/views/cache/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index edf9145d..3ae2d2b3 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -126,7 +126,7 @@ $(function() { $it) { $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); - $_it = mb_convert_encoding($it, 'UTF-8', $encode); + $_it = mb_convert_encoding($it, 'UTF8', $encode); ?> From 548166a6f7ae5a166a5ca3f95986c4f03198635b Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:33:50 +0800 Subject: [PATCH 10/11] ok --- application/views/cache/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index 3ae2d2b3..de846dc5 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -125,7 +125,7 @@ $(function() { $it) { - $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $encode = mb_detect_encoding($it, array('ASCII','GBK','ISO-8859-1','UTF-8')); $_it = mb_convert_encoding($it, 'UTF8', $encode); ?> From a1166693e42e0d69d2b0e2fe5e6cc3092ba9979a Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:40:24 +0800 Subject: [PATCH 11/11] not encode --- application/views/cache/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/cache/update.php b/application/views/cache/update.php index de846dc5..59785963 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -42,7 +42,7 @@ $(function() { var current = dom.eq(star); if (current.length) { var file = current.find('.file').attr('title'); - file = encodeURI(file); + //file = encodeURI(file); current.find('.msg_wait').css('color','red').html('更新中'); $.ajax({ url : '',