Merge pull request #1098 from Alkarex/HTTPS-enclosures

SimplePie force HTTPS for enclosures
This commit is contained in:
Alexandre Alapetite
2016-03-01 20:53:25 +01:00
2 changed files with 3 additions and 6 deletions

View File

@@ -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);

View File

@@ -292,10 +292,6 @@ class SimplePie_Sanitize
$node =& $this->https_domains;
foreach ($segments as $segment)
{//Explore the tree
if ($node === true)
{
return true;
}
if (isset($node[$segment]))
{
$node =& $node[$segment];
@@ -305,14 +301,14 @@ class SimplePie_Sanitize
break;
}
}
return false;
return $node === true;
}
/**
* 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)) ?