Commit fd1c2cb401 for wordpress.org

commit fd1c2cb4011845ceb7244a062b09b2506082b1c9
Author: desrosj <desrosj@git.wordpress.org>
Date:   Fri Oct 16 17:20:07 2020 +0000

    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.
    Built from https://develop.svn.wordpress.org/trunk@49176


    git-svn-id: http://core.svn.wordpress.org/trunk@48938 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/SimplePie/Content/Type/Sniffer.php b/wp-includes/SimplePie/Content/Type/Sniffer.php
index 39972b5a76..027e131ef9 100644
--- a/wp-includes/SimplePie/Content/Type/Sniffer.php
+++ b/wp-includes/SimplePie/Content/Type/Sniffer.php
@@ -150,7 +150,7 @@ class SimplePie_Content_Type_Sniffer
 		}
 		elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
 		{
-			return 'application/octect-stream';
+			return 'application/octet-stream';
 		}

 		return 'text/plain';
diff --git a/wp-includes/SimplePie/File.php b/wp-includes/SimplePie/File.php
index 82db47ec9b..90ad8196a6 100644
--- a/wp-includes/SimplePie/File.php
+++ b/wp-includes/SimplePie/File.php
@@ -109,11 +109,6 @@ class SimplePie_File
 				curl_setopt($fp, CURLOPT_REFERER, $url);
 				curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
 				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) {
 					curl_setopt($fp, $curl_param, $curl_value);
 				}
@@ -148,7 +143,7 @@ class SimplePie_File
 							$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;
 						}
@@ -233,7 +228,7 @@ class SimplePie_File
 								$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;
 							}
diff --git a/wp-includes/SimplePie/Locator.php b/wp-includes/SimplePie/Locator.php
index bf7c21a6f0..a207df6fee 100644
--- a/wp-includes/SimplePie/Locator.php
+++ b/wp-includes/SimplePie/Locator.php
@@ -94,7 +94,7 @@ class SimplePie_Locator
 		$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))
 		{
diff --git a/wp-includes/SimplePie/Misc.php b/wp-includes/SimplePie/Misc.php
index 48d7c860aa..a52498ac76 100644
--- a/wp-includes/SimplePie/Misc.php
+++ b/wp-includes/SimplePie/Misc.php
@@ -364,11 +364,12 @@ class SimplePie_Misc
 		}

 		// 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;
 		}
diff --git a/wp-includes/class-simplepie.php b/wp-includes/class-simplepie.php
index 6bb5bf75fc..ff55274509 100644
--- a/wp-includes/class-simplepie.php
+++ b/wp-includes/class-simplepie.php
@@ -68,7 +68,7 @@ spl_autoload_register( 'wp_simplepie_autoload' );
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * @package SimplePie
- * @version 1.5.5
+ * @version 1.5.6
  * @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue
  * @author Ryan Parman
  * @author Sam Sneddon
@@ -85,7 +85,7 @@ define('SIMPLEPIE_NAME', 'SimplePie');
 /**
  * SimplePie Version
  */
-define('SIMPLEPIE_VERSION', '1.5.5');
+define('SIMPLEPIE_VERSION', '1.5.6');

 /**
  * SimplePie Build
diff --git a/wp-includes/version.php b/wp-includes/version.php
index ec0bfdd5f0..6fcd679319 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '5.6-alpha-49175';
+$wp_version = '5.6-alpha-49176';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.