diff options
| author | 2021-04-17 18:10:47 +0200 | |
|---|---|---|
| committer | 2021-04-17 18:10:47 +0200 | |
| commit | d0d5f1ce3f6f617e2ee1a37253ddad9687eba71c (patch) | |
| tree | 5ae0d84e8dcd461ade04780367906854749084ab | |
| parent | 27372b5bb7e8059c8cc4d2ff5c2fe5a0315a0191 (diff) | |
Merge SimplePie changes (#3588)
Related to https://github.com/simplepie/simplepie/pull/676
from https://github.com/FreshRSS/FreshRSS/pull/1087
| -rw-r--r-- | lib/SimplePie/SimplePie.php | 4 | ||||
| -rw-r--r-- | lib/SimplePie/SimplePie/Sanitize.php | 22 |
2 files changed, 11 insertions, 15 deletions
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index 0acad05d8..ec95861cd 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -1308,9 +1308,9 @@ class SimplePie } /** - * Set the list of domains for which force HTTPS. + * Set the list of domains for which to force HTTPS. * @see SimplePie_Sanitize::set_https_domains() - * FreshRSS + * @param array List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net'). */ public function set_https_domains($domains = array()) { diff --git a/lib/SimplePie/SimplePie/Sanitize.php b/lib/SimplePie/SimplePie/Sanitize.php index 4805974bb..7d83bbbf1 100644 --- a/lib/SimplePie/SimplePie/Sanitize.php +++ b/lib/SimplePie/SimplePie/Sanitize.php @@ -73,13 +73,12 @@ class SimplePie_Sanitize var $replace_url_attributes = null; /** - * List of domains for which force HTTPS. + * List of domains for which to force HTTPS. * @see SimplePie_Sanitize::set_https_domains() - * Array is tree split at DNS levels. Example: - * array('biz' => true, 'com' => array('example' => true), 'net' => array('example') => array('www' => true)) - * FreshRSS + * Array is a tree split at DNS levels. Example: + * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true))) */ - var $https_domains = array('com' => array('dailymotion' => true, 'youtube' => true)); + var $https_domains = array(); public function __construct() { @@ -251,10 +250,9 @@ class SimplePie_Sanitize } /** - * Set the list of domains for which force HTTPS. + * Set the list of domains for which to force HTTPS. * @see SimplePie_Misc::https_url() * Example array('biz', 'example.com', 'example.org', 'www.example.net'); - * FreshRSS */ public function set_https_domains($domains) { @@ -281,8 +279,7 @@ class SimplePie_Sanitize } /** - * Check if the domain is in the list of forced HTTPS - * FreshRSS + * Check if the domain is in the list of forced HTTPS. */ protected function is_https_domain($domain) { @@ -304,8 +301,7 @@ class SimplePie_Sanitize } /** - * Force HTTPS for selected Web sites - * FreshRSS + * Force HTTPS for selected Web sites. */ public function https_url($url) { @@ -516,9 +512,9 @@ class SimplePie_Sanitize if ($element->hasAttribute($attribute)) { $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); - $value = $this->https_url($value); //FreshRSS - if ($value) + if ($value !== false) { + $value = $this->https_url($value); $element->setAttribute($attribute, $value); } } |
