Skip to content

Commit

Permalink
Mise à jour de SimplePie (1.5.4 -> v1.5.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbgodin committed Feb 25, 2021
1 parent b668f67 commit ce2c2c8
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions SimplePie.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
/**
* SimplePie Version
*/
define('SIMPLEPIE_VERSION', '1.5.4');
define('SIMPLEPIE_VERSION', '1.5.6');

/**
* SimplePie Build
* @todo Hardcode for release (there's no need to have to call SimplePie_Misc::get_build() only every load of simplepie.inc)
*/
define('SIMPLEPIE_BUILD', '20200203211057');
define('SIMPLEPIE_BUILD', '20210225192239');

/**
* SimplePie Website URL
Expand Down Expand Up @@ -706,7 +706,7 @@ public function __toString()
*/
public function __destruct()
{
if ((version_compare(PHP_VERSION, '5.6', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
if (!gc_enabled())
{
if (!empty($this->data['items']))
{
Expand Down Expand Up @@ -1373,7 +1373,8 @@ public function init()
// Decide whether to enable caching
if ($this->cache && $parsed_feed_url['scheme'] !== '')
{
$cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc'));
$url = $this->feed_url . ($this->force_feed ? '#force_feed' : '');
$cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $url), 'spc'));
}

// Fetch the data via SimplePie_File into $this->raw_data
Expand Down Expand Up @@ -4931,7 +4932,7 @@ public function text_or_binary()
}
elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
{
return 'application/octect-stream';
return 'application/octet-stream';
}

return 'text/plain';
Expand Down Expand Up @@ -7206,11 +7207,6 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = null
curl_setopt($fp, CURLOPT_REFERER, $url);
curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>='))
{
curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects);
}
foreach ($curl_options as $curl_param => $curl_value) {
curl_setopt($fp, $curl_param, $curl_value);
}
Expand Down Expand Up @@ -7245,7 +7241,7 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = null
$this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
$previousStatusCode = $this->status_code;
$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);
$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
$this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
return;
}
Expand Down Expand Up @@ -7330,7 +7326,7 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = null
$this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
$previousStatusCode = $this->status_code;
$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);
$this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
$this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
return;
}
Expand Down Expand Up @@ -9149,7 +9145,7 @@ public function __toString()
*/
public function __destruct()
{
if ((version_compare(PHP_VERSION, '5.6', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
if (!gc_enabled())
{
unset($this->feed);
}
Expand Down Expand Up @@ -12046,7 +12042,7 @@ public function set_registry(SimplePie_Registry $registry)
$this->registry = $registry;
}
public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working = null)
{
if ($this->is_feed($this->file))
{
Expand Down Expand Up @@ -12698,11 +12694,12 @@ protected static function change_encoding_mbstring($data, $input, $output)
}
// Check that the encoding is supported
if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
if (!in_array($input, mb_list_encodings()))
{
return false;
}
if (!in_array($input, mb_list_encodings()))
if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
{
return false;
}
Expand Down Expand Up @@ -17171,7 +17168,6 @@ protected function preprocess($html, $type)

$ret .= '<html><head>';
$ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />';
$ret .= '<meta name="referrer" content="no-referrer" />';
$ret .= '</head><body>' . $html . '</body></html>';
return $ret;
}
Expand Down Expand Up @@ -18508,3 +18504,4 @@ public function parse()
return false;
}
}

0 comments on commit ce2c2c8

Please sign in to comment.