Browse Source

加入$Scheme;解决https采集问题

tags/6.0.0
xushulang GitHub 4 years ago
parent
commit
a8bb29fbfe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      src/include/dedehtml2.class.php

+ 9
- 2
src/include/dedehtml2.class.php View File

@@ -30,6 +30,7 @@ class DedeHtml2
var $CharSet;
var $BaseUrl;
var $BaseUrlPath;
var $Scheme;
var $HomeUrl;
var $IsHead;
var $ImgHeight;
@@ -47,6 +48,7 @@ class DedeHtml2
$this->Links = Array();
$this->BaseUrl = '';
$this->BaseUrlPath = '';
$this->Scheme = 'http://';
$this->HomeUrl = '';
$this->IsHead = false;
$this->ImgHeight = 30;
@@ -77,6 +79,7 @@ class DedeHtml2
$this->BaseUrl = $url;
//判断文档相对于当前的路径
$urls = @parse_url($url);
$this->Scheme = $urls['scheme'] . '://';
$this->HomeUrl = $urls['host'];
$this->BaseUrlPath = $this->HomeUrl.$urls['path'];
$this->BaseUrlPath = preg_replace("/\/([^\/]*)\.(.*)$/","/",$this->BaseUrlPath);
@@ -398,6 +401,10 @@ class DedeHtml2
else if( strtolower(substr($surl,0,7))=='http://' )
{
$okurl = preg_replace('/^http:\/\//i', '', $surl);
}
else if( strtolower(substr($surl,0,8))=='https://' )
{
$okurl = preg_replace('/^https:\/\//i', '', $surl);
}
else
{
@@ -405,7 +412,7 @@ class DedeHtml2
}
}
$okurl = preg_replace('/\/{1,}/i', '/', $okurl);
return 'http://'.$okurl;
return $this->Scheme . $okurl;
}

/**
@@ -671,4 +678,4 @@ class DedeAttribute2

}//End Class DedeAttribute2

?>
?>

Loading…
Cancel
Save