Browse Source

修正单页采集的错误

tags/6.2.0
tianya 1 year ago
parent
commit
39b7c91a6e
4 changed files with 4 additions and 4 deletions
  1. +1
    -1
      src/admin/article_add.php
  2. +1
    -1
      src/admin/config.php
  3. +1
    -1
      src/admin/inc/inc_coonepage.php
  4. +1
    -1
      src/system/libraries/dedehttpdown.class.php

+ 1
- 1
src/admin/article_add.php View File

@@ -25,7 +25,7 @@ if ($dopost != 'save') {
if (empty($geturl)) $geturl = '';
$keywords = $writer = $source = $body = $description = $title = '';
//采集单个网页
if (preg_match("#^http:\/\/#", $geturl)) {
if (preg_match("#^(http|https):\/\/#", $geturl)) {
require_once(DEDEADMIN."/inc/inc_coonepage.php");
$redatas = CoOnePage($geturl);
extract((array)$redatas);


+ 1
- 1
src/admin/config.php View File

@@ -61,7 +61,7 @@ function XSSClean($val)
{
if (is_array($val)) {
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]);
}
return $val;


+ 1
- 1
src/admin/inc/inc_coonepage.php View File

@@ -20,7 +20,7 @@ function CoOnePage($gurl)
{
global $dsql, $cfg_auot_description, $cfg_soft_lang;
$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']);
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '".$redatas['source']."' ");
$s = $e = '';


+ 1
- 1
src/system/libraries/dedehttpdown.class.php View File

@@ -324,7 +324,7 @@ class DedeHttpDown
}
if (function_exists('curl_init') && function_exists('curl_exec')) {
$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_FOLLOWLOCATION, 1);
if ($requestType == "POST") {


Loading…
Cancel
Save