From 1ef23a171b7aaedba116c3ce4661d0ff00850eb6 Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 18 Feb 2019 10:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96amp=E8=BD=AC=E5=8C=96?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../htmlcompressor/controllers/index_gm.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/application/third_party/htmlcompressor/controllers/index_gm.php b/application/third_party/htmlcompressor/controllers/index_gm.php index 70f68352..7d5d6062 100644 --- a/application/third_party/htmlcompressor/controllers/index_gm.php +++ b/application/third_party/htmlcompressor/controllers/index_gm.php @@ -16,17 +16,11 @@ class Index_gm extends CI_Controller //选择处理方式 public function choose_way(){ - /*$this->htmlsource = $this->input->post('htmlsource'); + $this->htmlsource = $this->input->post('htmlsource'); $this->websitehost = $this->input->post('websitehost'); $this->template_name = $this->input->post('template_name'); $this->create_amp = $this->input->post('create_amp'); - $this->debug = $this->input->post('debug');*/ - - $this->htmlsource = file_get_contents('amp.htm'); - $this->websitehost = 'https://data.chinarundreisen.com'; - $this->template_name = 'gm'; - $this->create_amp = 'true'; - $this->debug = 'false'; + $this->debug = $this->input->post('debug'); if (empty($this->htmlsource) || empty($this->websitehost)) { $this->output->set_status_header(500); @@ -325,13 +319,12 @@ class Index_gm extends CI_Controller return FALSE; } - $style_content = str_replace('!important', '', $optimize_css); - $style_content = str_replace('@charset "utf-8";', '', $optimize_css); + $optimize_css = str_replace('!important', '', $optimize_css); + $optimize_css = str_replace('@charset "utf-8";', '', $optimize_css); $amp_template = str_replace('/*@CUSTOM-CSS@*/', $optimize_css, $amp_template); //替换掉写在组件上的样式 $amp_template = preg_replace('/style=.+?[\'|"]/i', '', $amp_template); - echo $amp_template;die(); echo json_encode(array('result' => 'ok', 'data' => array('amp' => $amp_template))); }