mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-17 21:04:41 -04:00
Merge pull request #1098 from Alkarex/HTTPS-enclosures
SimplePie force HTTPS for enclosures
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)) ?
|
||||
|
||||
Reference in New Issue
Block a user