| @@ -25,7 +25,7 @@ if ($dopost != 'save') { | |||||
| if (empty($geturl)) $geturl = ''; | if (empty($geturl)) $geturl = ''; | ||||
| $keywords = $writer = $source = $body = $description = $title = ''; | $keywords = $writer = $source = $body = $description = $title = ''; | ||||
| //采集单个网页 | //采集单个网页 | ||||
| if (preg_match("#^http:\/\/#", $geturl)) { | |||||
| if (preg_match("#^(http|https):\/\/#", $geturl)) { | |||||
| require_once(DEDEADMIN."/inc/inc_coonepage.php"); | require_once(DEDEADMIN."/inc/inc_coonepage.php"); | ||||
| $redatas = CoOnePage($geturl); | $redatas = CoOnePage($geturl); | ||||
| extract((array)$redatas); | extract((array)$redatas); | ||||
| @@ -61,7 +61,7 @@ function XSSClean($val) | |||||
| { | { | ||||
| if (is_array($val)) { | if (is_array($val)) { | ||||
| foreach ($val as $key => $v) { | foreach ($val as $key => $v) { | ||||
| if (in_array($key, array('tags', 'body', 'dede_fields', 'dede_addonfields', 'dopost', 'introduce'))) continue; | |||||
| if (in_array($key, array('tags', 'body', 'dede_fields', 'dede_addonfields', 'dopost', 'introduce', 'geturl'))) continue; | |||||
| $val[$key] = XSSClean($val[$key]); | $val[$key] = XSSClean($val[$key]); | ||||
| } | } | ||||
| return $val; | return $val; | ||||
| @@ -20,7 +20,7 @@ function CoOnePage($gurl) | |||||
| { | { | ||||
| global $dsql, $cfg_auot_description, $cfg_soft_lang; | global $dsql, $cfg_auot_description, $cfg_soft_lang; | ||||
| $redatas = array('title' => '', 'body' => '', 'source' => '', 'writer' => '', 'description' => '', 'keywords' => ''); | $redatas = array('title' => '', 'body' => '', 'source' => '', 'writer' => '', 'description' => '', 'keywords' => ''); | ||||
| $redatas['source'] = preg_replace("/http:\/\//i", "", $gurl); | |||||
| $redatas['source'] = preg_replace("/(http|https):\/\//i", "", $gurl); | |||||
| $redatas['source'] = preg_replace("/\/(.*)$/i", "", $redatas['source']); | $redatas['source'] = preg_replace("/\/(.*)$/i", "", $redatas['source']); | ||||
| $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '".$redatas['source']."' "); | $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '".$redatas['source']."' "); | ||||
| $s = $e = ''; | $s = $e = ''; | ||||
| @@ -324,7 +324,7 @@ class DedeHttpDown | |||||
| } | } | ||||
| if (function_exists('curl_init') && function_exists('curl_exec')) { | if (function_exists('curl_init') && function_exists('curl_exec')) { | ||||
| $this->m_ch = curl_init(); | $this->m_ch = curl_init(); | ||||
| curl_setopt($this->m_ch, CURLOPT_URL, $this->m_scheme.'://'.$this->m_host.':'.$this->m_port.$this->m_path); | |||||
| curl_setopt($this->m_ch, CURLOPT_URL, $this->m_scheme.'://'.$this->m_host.':'.$this->m_port.$this->m_path.'?'.$this->m_query); | |||||
| curl_setopt($this->m_ch, CURLOPT_RETURNTRANSFER, 1); | curl_setopt($this->m_ch, CURLOPT_RETURNTRANSFER, 1); | ||||
| curl_setopt($this->m_ch, CURLOPT_FOLLOWLOCATION, 1); | curl_setopt($this->m_ch, CURLOPT_FOLLOWLOCATION, 1); | ||||
| if ($requestType == "POST") { | if ($requestType == "POST") { | ||||