From a4741afa2e059eb0f14561565cdb80a5c4ded8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Wed, 21 Jun 2017 13:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=90=8E=E4=B8=8D=E7=94=9F=E6=88=90=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../htmlcompressor/controllers/index.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/application/third_party/htmlcompressor/controllers/index.php b/application/third_party/htmlcompressor/controllers/index.php index fceba443..bbf12e44 100644 --- a/application/third_party/htmlcompressor/controllers/index.php +++ b/application/third_party/htmlcompressor/controllers/index.php @@ -41,7 +41,13 @@ class Index extends CI_Controller { } //print_r($link_css_array); foreach ($link_css_array as $item) { - $css_content.= GET_HTTP($this->format_url($item, $websitehost)); + $get_http_temp = GET_HTTP($this->format_url($item, $websitehost)); + if ($get_http_temp == false) { + $this->output->set_status_header(404); + echo 'CSS文件下载错误'; + return FALSE; + } + $css_content.=$get_http_temp; } foreach ($html_object->find('style') as $style_css) { if ($style_css->type == "text/css") { @@ -75,7 +81,13 @@ class Index extends CI_Controller { $js_scr_content = ''; foreach ($link_js_array as $item) { - $js_scr_content.= GET_HTTP($this->format_url($item, $websitehost)); + $get_http_temp = GET_HTTP($this->format_url($item, $websitehost)); + if ($get_http_temp == false) { + $this->output->set_status_header(404); + echo 'JS文件下载错误'; + return FALSE; + } + $js_scr_content.=$get_http_temp; } //echo $js_content; //把网页内容和css提交到purifycss处理 @@ -83,7 +95,6 @@ class Index extends CI_Controller { if (empty($optimize_css)) { $this->output->set_status_header(500); echo 'css精简错误'; - echo ''; return FALSE; }