瀏覽代碼

SimplePie force HTTPS for enclosures

https://github.com/FreshRSS/FreshRSS/issues/1083
https://github.com/FreshRSS/FreshRSS/pull/1087
Alexandre Alapetite 10 年之前
父節點
當前提交
0eef625b6d
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      lib/SimplePie/SimplePie/Item.php
  2. 1 1
      lib/SimplePie/SimplePie/Sanitize.php

+ 1 - 0
lib/SimplePie/SimplePie/Item.php

@@ -2877,6 +2877,7 @@ class SimplePie_Item
 					$width = null;
 
 					$url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));
+					$url = $this->feed->sanitize->https_url($url);	//FreshRSS
 					if (isset($enclosure[0]['attribs']['']['type']))
 					{
 						$type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);

+ 1 - 1
lib/SimplePie/SimplePie/Sanitize.php

@@ -312,7 +312,7 @@ class SimplePie_Sanitize
 	 * Force HTTPS for selected Web sites
 	 * FreshRSS
 	 */
-	protected function https_url($url)
+	public function https_url($url)
 	{
 		return (strtolower(substr($url, 0, 7)) === 'http://') &&
 			$this->is_https_domain(parse_url($url, PHP_URL_HOST)) ?