External Libraries: Update the SimplePie library to version 1.5.6.

This version fixes a handful of PHP 8 compatibility issues.

A full list of changes included in this update can be found on GitHub: https://github.com/simplepie/simplepie/compare/1.5.5...1.5.6.

Props jrf, ayeshrajans.
Fixes #51521.

git-svn-id: https://develop.svn.wordpress.org/trunk@49176 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2020-10-16 17:18:11 +00:00
parent b52dd8a173
commit f3f2aa135e
5 changed files with 9 additions and 13 deletions

View File

@ -150,7 +150,7 @@ class SimplePie_Content_Type_Sniffer
} }
elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
{ {
return 'application/octect-stream'; return 'application/octet-stream';
} }
return 'text/plain'; return 'text/plain';

View File

@ -109,11 +109,6 @@ class SimplePie_File
curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_REFERER, $url);
curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
if (!ini_get('open_basedir') && 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) { foreach ($curl_options as $curl_param => $curl_value) {
curl_setopt($fp, $curl_param, $curl_value); curl_setopt($fp, $curl_param, $curl_value);
} }
@ -148,7 +143,7 @@ class SimplePie_File
$this->redirects++; $this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
$previousStatusCode = $this->status_code; $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; $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
return; return;
} }
@ -233,7 +228,7 @@ class SimplePie_File
$this->redirects++; $this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
$previousStatusCode = $this->status_code; $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; $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
return; return;
} }

View File

@ -94,7 +94,7 @@ class SimplePie_Locator
$this->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)) if ($this->is_feed($this->file))
{ {

View File

@ -364,11 +364,12 @@ class SimplePie_Misc
} }
// Check that the encoding is supported // 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; return false;
} }
if (!in_array($input, mb_list_encodings()))
if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
{ {
return false; return false;
} }

View File

@ -68,7 +68,7 @@ spl_autoload_register( 'wp_simplepie_autoload' );
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
* @package SimplePie * @package SimplePie
* @version 1.5.5 * @version 1.5.6
* @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue * @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue
* @author Ryan Parman * @author Ryan Parman
* @author Sam Sneddon * @author Sam Sneddon
@ -85,7 +85,7 @@ define('SIMPLEPIE_NAME', 'SimplePie');
/** /**
* SimplePie Version * SimplePie Version
*/ */
define('SIMPLEPIE_VERSION', '1.5.5'); define('SIMPLEPIE_VERSION', '1.5.6');
/** /**
* SimplePie Build * SimplePie Build