From a8bb29fbfe00ca5d15c66519779d7d2fc7809f15 Mon Sep 17 00:00:00 2001 From: xushulang <52433214+xushulang@users.noreply.github.com> Date: Tue, 2 Jul 2019 11:04:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=A0=E5=85=A5$Scheme;=E8=A7=A3?= =?UTF-8?q?=E5=86=B3https=E9=87=87=E9=9B=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/dedehtml2.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/include/dedehtml2.class.php b/src/include/dedehtml2.class.php index 5f5c847f..ef9d9b62 100755 --- a/src/include/dedehtml2.class.php +++ b/src/include/dedehtml2.class.php @@ -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 -?> \ No newline at end of file +?> From 0031252d486603c568bf14191a4b3c097c5ac352 Mon Sep 17 00:00:00 2001 From: xushulang <52433214+xushulang@users.noreply.github.com> Date: Tue, 2 Jul 2019 11:16:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96https=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {src/include => Src/包括}/dedehtml2.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {src/include => Src/包括}/dedehtml2.class.php (99%) diff --git a/src/include/dedehtml2.class.php b/Src/包括/dedehtml2.class.php similarity index 99% rename from src/include/dedehtml2.class.php rename to Src/包括/dedehtml2.class.php index ef9d9b62..06b47518 100755 --- a/src/include/dedehtml2.class.php +++ b/Src/包括/dedehtml2.class.php @@ -48,7 +48,7 @@ class DedeHtml2 $this->Links = Array(); $this->BaseUrl = ''; $this->BaseUrlPath = ''; - $this->Scheme = 'http://'; + $this->Scheme = 'http://'; $this->HomeUrl = ''; $this->IsHead = false; $this->ImgHeight = 30; @@ -79,7 +79,7 @@ class DedeHtml2 $this->BaseUrl = $url; //判断文档相对于当前的路径 $urls = @parse_url($url); - $this->Scheme = $urls['scheme'] . '://'; + $this->Scheme = $urls['scheme'] . '://'; $this->HomeUrl = $urls['host']; $this->BaseUrlPath = $this->HomeUrl.$urls['path']; $this->BaseUrlPath = preg_replace("/\/([^\/]*)\.(.*)$/","/",$this->BaseUrlPath); @@ -402,7 +402,7 @@ class DedeHtml2 { $okurl = preg_replace('/^http:\/\//i', '', $surl); } - else if( strtolower(substr($surl,0,8))=='https://' ) + else if( strtolower(substr($surl,0,8))=='https://' ) { $okurl = preg_replace('/^https:\/\//i', '', $surl); }