<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[52393] trunk/src/wp-includes: External Libraries: Update the SimplePie library to version 1.5.7.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/52393">52393</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/52393","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-12-20 19:31:37 +0000 (Mon, 20 Dec 2021)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>External Libraries: Update the SimplePie library to version 1.5.7.

This version shows significant improvements in the compatibility of SimplePie with PHP 8.0, 8.1, and even contains an initial PHP 8.2 fix. The release also contains a number of other bug fixes.

Release notes: https://github.com/simplepie/simplepie/releases/tag/1.5.7

For a full list of changes in this update, see the SimplePie GitHub:
https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7

Follow-up to <a href="https://core.trac.wordpress.org/changeset/47733">[47733]</a>, <a href="https://core.trac.wordpress.org/changeset/49176">[49176]</a>.

Props jrf, SergeyBiryukov.
Fixes <a href="https://core.trac.wordpress.org/ticket/54659">#54659</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesSimplePieCacheRedisphp">trunk/src/wp-includes/SimplePie/Cache/Redis.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieEnclosurephp">trunk/src/wp-includes/SimplePie/Enclosure.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieFilephp">trunk/src/wp-includes/SimplePie/File.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieHTTPParserphp">trunk/src/wp-includes/SimplePie/HTTP/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieItemphp">trunk/src/wp-includes/SimplePie/Item.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieLocatorphp">trunk/src/wp-includes/SimplePie/Locator.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieMiscphp">trunk/src/wp-includes/SimplePie/Misc.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieParserphp">trunk/src/wp-includes/SimplePie/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieRegistryphp">trunk/src/wp-includes/SimplePie/Registry.php</a></li>
<li><a href="#trunksrcwpincludesSimplePieSanitizephp">trunk/src/wp-includes/SimplePie/Sanitize.php</a></li>
<li><a href="#trunksrcwpincludesclasssimplepiephp">trunk/src/wp-includes/class-simplepie.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesSimplePieCacheRedisphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Cache/Redis.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Cache/Redis.php   2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Cache/Redis.php     2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         if ($data !== false) {
</span><span class="cx" style="display: block; padding: 0 10px">             $return = $this->cache->set($this->name, $data);
</span><span class="cx" style="display: block; padding: 0 10px">             if ($this->options['expire']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $this->cache->expire($this->name, $this->ttl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                return $this->cache->expire($this->name, $this->options['expire']);
</ins><span class="cx" style="display: block; padding: 0 10px">             }
</span><span class="cx" style="display: block; padding: 0 10px">             return $return;
</span><span class="cx" style="display: block; padding: 0 10px">         }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieEnclosurephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Enclosure.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Enclosure.php     2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Enclosure.php       2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1152,7 +1152,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // If we encounter an unsupported mime-type, check the file extension and guess intelligently.
</span><span class="cx" style="display: block; padding: 0 10px">                if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))
</span><span class="cx" style="display: block; padding: 0 10px">                {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        switch (strtolower($this->get_extension()))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $extension = $this->get_extension();
+                       if ($extension === null) {
+                               return null;
+                       }
+
+                       switch (strtolower($extension))
</ins><span class="cx" style="display: block; padding: 0 10px">                         {
</span><span class="cx" style="display: block; padding: 0 10px">                                // Audio mime-types
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'aac':
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieFilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/File.php  2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/File.php    2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                curl_setopt($fp, CURLOPT_FAILONERROR, 1);
</span><span class="cx" style="display: block; padding: 0 10px">                                curl_setopt($fp, CURLOPT_TIMEOUT, $timeout);
</span><span class="cx" style="display: block; padding: 0 10px">                                curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                curl_setopt($fp, CURLOPT_REFERER, $url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url));
</ins><span class="cx" style="display: block; padding: 0 10px">                                 curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
</span><span class="cx" style="display: block; padding: 0 10px">                                curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
</span><span class="cx" style="display: block; padding: 0 10px">                                foreach ($curl_options as $curl_param => $curl_value) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,6 +119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        curl_setopt($fp, CURLOPT_ENCODING, 'none');
</span><span class="cx" style="display: block; padding: 0 10px">                                        $this->headers = curl_exec($fp);
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE);
</ins><span class="cx" style="display: block; padding: 0 10px">                                 if (curl_errno($fp))
</span><span class="cx" style="display: block; padding: 0 10px">                                {
</span><span class="cx" style="display: block; padding: 0 10px">                                        $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp);
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieHTTPParserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/HTTP/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/HTTP/Parser.php   2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/HTTP/Parser.php     2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,11 +507,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        {
</span><span class="cx" style="display: block; padding: 0 10px">                $data = explode("\r\n\r\n", $headers, $count);
</span><span class="cx" style="display: block; padding: 0 10px">                $data = array_pop($data);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n\r\n")) {
-                       $data = str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) {
+                       $exploded = explode("\r\n\r\n", $data, 2);
+                       $data = end($exploded);
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n\r\n")) {
-                       $data = str_ireplace("HTTP/1.1 200 Connection established\r\n\r\n", '', $data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) {
+                       $exploded = explode("\r\n\r\n", $data, 2);
+                       $data = end($exploded);
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">                return $data;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieItemphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Item.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Item.php  2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Item.php    2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1803,7 +1803,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if (isset($content['attribs']['']['fileSize']))
</span><span class="cx" style="display: block; padding: 0 10px">                                                        {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                $length = ceil($content['attribs']['']['fileSize']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                         $length = intval($content['attribs']['']['fileSize']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                                         }
</span><span class="cx" style="display: block; padding: 0 10px">                                                        if (isset($content['attribs']['']['medium']))
</span><span class="cx" style="display: block; padding: 0 10px">                                                        {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2425,7 +2425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                }
</span><span class="cx" style="display: block; padding: 0 10px">                                                if (isset($content['attribs']['']['fileSize']))
</span><span class="cx" style="display: block; padding: 0 10px">                                                {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        $length = ceil($content['attribs']['']['fileSize']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 $length = intval($content['attribs']['']['fileSize']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                                                if (isset($content['attribs']['']['medium']))
</span><span class="cx" style="display: block; padding: 0 10px">                                                {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2790,7 +2790,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        if (isset($link['attribs']['']['length']))
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                $length = ceil($link['attribs']['']['length']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         $length = intval($link['attribs']['']['length']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px">                                        if (isset($link['attribs']['']['title']))
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2833,7 +2833,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        if (isset($link['attribs']['']['length']))
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                $length = ceil($link['attribs']['']['length']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         $length = intval($link['attribs']['']['length']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2862,6 +2862,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $width = null;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        $url = $this->feed->sanitize->https_url($url);
</ins><span class="cx" style="display: block; padding: 0 10px">                                         if (isset($enclosure[0]['attribs']['']['type']))
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><span class="cx" style="display: block; padding: 0 10px">                                                $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2868,7 +2869,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        if (isset($enclosure[0]['attribs']['']['length']))
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                $length = ceil($enclosure[0]['attribs']['']['length']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         $length = intval($enclosure[0]['attribs']['']['length']);
</ins><span class="cx" style="display: block; padding: 0 10px">                                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieLocatorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Locator.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Locator.php       2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Locator.php 2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,6 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        var $max_checked_feeds = 10;
</span><span class="cx" style="display: block; padding: 0 10px">        var $force_fsockopen = false;
</span><span class="cx" style="display: block; padding: 0 10px">        var $curl_options = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var $dom;
</ins><span class="cx" style="display: block; padding: 0 10px">         protected $registry;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = array())
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,12 +76,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->force_fsockopen = $force_fsockopen;
</span><span class="cx" style="display: block; padding: 0 10px">                $this->curl_options = $curl_options;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (class_exists('DOMDocument'))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if (class_exists('DOMDocument') && $this->file->body != '')
</ins><span class="cx" style="display: block; padding: 0 10px">                 {
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->dom = new DOMDocument();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        set_error_handler(array('SimplePie_Misc', 'silence_errors'));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->dom->loadHTML($this->file->body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 try
+                       {
+                               $this->dom->loadHTML($this->file->body);
+                       }
+                       catch (Throwable $ex)
+                       {
+                               $this->dom = null;
+                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                         restore_error_handler();
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">                else
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieMiscphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Misc.php  2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Misc.php    2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2260,4 +2260,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">        {
</span><span class="cx" style="display: block; padding: 0 10px">                // No-op
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * Sanitize a URL by removing HTTP credentials.
+        * @param string $url the URL to sanitize.
+        * @return string the same URL without HTTP credentials.
+        */
+       public static function url_remove_credentials($url)
+       {
+               return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieParserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Parser.php        2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Parser.php  2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,12 +164,30 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        xml_set_element_handler($xml, 'tag_open', 'tag_close');
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Parse!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if (!xml_parse($xml, $data, true))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory';
+                       if (($stream = fopen($wrapper, 'r+')) &&
+                               fwrite($stream, $data) &&
+                               rewind($stream))
</ins><span class="cx" style="display: block; padding: 0 10px">                         {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->error_code = xml_get_error_code($xml);
-                               $this->error_string = xml_error_string($this->error_code);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         //Parse by chunks not to use too much memory
+                               do
+                               {
+                                       $stream_data = fread($stream, 1048576);
+                                       if (!xml_parse($xml, $stream_data === false ? '' : $stream_data, feof($stream)))
+                                       {
+                                               $this->error_code = xml_get_error_code($xml);
+                                               $this->error_string = xml_error_string($this->error_code);
+                                               $return = false;
+                                               break;
+                                       }
+                               } while (!feof($stream));
+                               fclose($stream);
+                       }
+                       else
+                       {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $return = false;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->current_line = xml_get_current_line_number($xml);
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->current_column = xml_get_current_column_number($xml);
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->current_byte = xml_get_current_byte_index($xml);
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieRegistryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Registry.php      2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Registry.php        2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +208,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        {
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'Cache':
</span><span class="cx" style="display: block; padding: 0 10px">                                        // For backwards compatibility with old non-static
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        // Cache::create() methods
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 // Cache::create() methods in PHP < 8.0.
+                                       // No longer supported as of PHP 8.0.
</ins><span class="cx" style="display: block; padding: 0 10px">                                         if ($method === 'get_handler')
</span><span class="cx" style="display: block; padding: 0 10px">                                        {
</span><span class="cx" style="display: block; padding: 0 10px">                                                $result = @call_user_func_array(array($class, 'create'), $parameters);
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePieSanitizephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/SimplePie/Sanitize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/Sanitize.php      2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/SimplePie/Sanitize.php        2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">        var $useragent = '';
</span><span class="cx" style="display: block; padding: 0 10px">        var $force_fsockopen = false;
</span><span class="cx" style="display: block; padding: 0 10px">        var $replace_url_attributes = null;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        var $registry;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        /**
+        * List of domains for which to force HTTPS.
+        * @see SimplePie_Sanitize::set_https_domains()
+        * 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();
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function __construct()
</span><span class="cx" style="display: block; padding: 0 10px">        {
</span><span class="cx" style="display: block; padding: 0 10px">                // Set defaults
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -241,6 +250,68 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->replace_url_attributes = (array) $element_attribute;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        /**
+        * 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');
+        */
+       public function set_https_domains($domains)
+       {
+               $this->https_domains = array();
+               foreach ($domains as $domain)
+               {
+                       $domain = trim($domain, ". \t\n\r\0\x0B");
+                       $segments = array_reverse(explode('.', $domain));
+                       $node =& $this->https_domains;
+                       foreach ($segments as $segment)
+                       {//Build a tree
+                               if ($node === true)
+                               {
+                                       break;
+                               }
+                               if (!isset($node[$segment]))
+                               {
+                                       $node[$segment] = array();
+                               }
+                               $node =& $node[$segment];
+                       }
+                       $node = true;
+               }
+       }
+
+       /**
+        * Check if the domain is in the list of forced HTTPS.
+        */
+       protected function is_https_domain($domain)
+       {
+               $domain = trim($domain, '. ');
+               $segments = array_reverse(explode('.', $domain));
+               $node =& $this->https_domains;
+               foreach ($segments as $segment)
+               {//Explore the tree
+                       if (isset($node[$segment]))
+                       {
+                               $node =& $node[$segment];
+                       }
+                       else
+                       {
+                               break;
+                       }
+               }
+               return $node === true;
+       }
+
+       /**
+        * Force HTTPS for selected Web sites.
+        */
+       public function https_url($url)
+       {
+               return (strtolower(substr($url, 0, 7)) === 'http://') &&
+                       $this->is_https_domain(parse_url($url, PHP_URL_HOST)) ?
+                       substr_replace($url, 's', 4, 0) :       //Add the 's' to HTTPS
+                       $url;
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         public function sanitize($data, $type, $base = '')
</span><span class="cx" style="display: block; padding: 0 10px">        {
</span><span class="cx" style="display: block; padding: 0 10px">                $data = trim($data);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -443,6 +514,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base));
</span><span class="cx" style="display: block; padding: 0 10px">                                                if ($value !== false)
</span><span class="cx" style="display: block; padding: 0 10px">                                                {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                        $value = $this->https_url($value);
</ins><span class="cx" style="display: block; padding: 0 10px">                                                         $element->setAttribute($attribute, $value);
</span><span class="cx" style="display: block; padding: 0 10px">                                                }
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span></span></pre></div>
<a id="trunksrcwpincludesclasssimplepiephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-simplepie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-simplepie.php 2021-12-20 16:48:54 UTC (rev 52392)
+++ trunk/src/wp-includes/class-simplepie.php   2021-12-20 19:31:37 UTC (rev 52393)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -460,6 +460,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public $error;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * @var int HTTP status code
+        * @see SimplePie::status_code()
+        * @access private
+        */
+       public $status_code;
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * @var object Instance of SimplePie_Sanitize (or other class)
</span><span class="cx" style="display: block; padding: 0 10px">         * @see SimplePie::set_sanitize_class()
</span><span class="cx" style="display: block; padding: 0 10px">         * @access private
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -944,6 +951,39 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL.
+        * @param string $url The URL of the feed to be cached.
+        * @return string A filename (i.e. hash, without path and without extension).
+        */
+       public function get_cache_filename($url)
+       {
+               // Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters.
+               $url .= $this->force_feed ? '#force_feed' : '';
+               $options = array();
+               if ($this->timeout != 10)
+               {
+                       $options[CURLOPT_TIMEOUT] = $this->timeout;
+               }
+               if ($this->useragent !== SIMPLEPIE_USERAGENT)
+               {
+                       $options[CURLOPT_USERAGENT] = $this->useragent;
+               }
+               if (!empty($this->curl_options))
+               {
+                       foreach ($this->curl_options as $k => $v)
+                       {
+                               $options[$k] = $v;
+                       }
+               }
+               if (!empty($options))
+               {
+                       ksort($options);
+                       $url .= '#' . urlencode(var_export($options, true));
+               }
+               return call_user_func($this->cache_name_function, $url);
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Set whether feed items should be sorted into reverse chronological order
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param bool $enable Sort as reverse chronological order.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1181,6 +1221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->strip_attributes(false);
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->add_attributes(false);
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->set_image_handler(false);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $this->set_https_domains(array());
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1284,6 +1325,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Set the list of domains for which to force HTTPS.
+        * @see SimplePie_Sanitize::set_https_domains()
+        * @param array List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net').
+        */
+       public function set_https_domains($domains = array())
+       {
+               if (is_array($domains))
+               {
+                       $this->sanitize->set_https_domains($domains);
+               }
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Set the handler to enable the display of cached images.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $page Web-accessible path to the handler_image.php file.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1408,8 +1462,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        // Decide whether to enable caching
</span><span class="cx" style="display: block; padding: 0 10px">                        if ($this->cache && $parsed_feed_url['scheme'] !== '')
</span><span class="cx" style="display: block; padding: 0 10px">                        {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $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'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $filename = $this->get_cache_filename($this->feed_url);
+                               $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $filename, 'spc'));
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Fetch the data via SimplePie_File into $this->raw_data
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1549,7 +1603,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Fetch the data via SimplePie_File
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * If the data is already cached, attempt to fetch it from there instead
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @param SimplePie_Cache|false $cache Cache handler, or false to not load from the cache
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @param SimplePie_Cache_Base|false $cache Cache handler, or false to not load from the cache
</ins><span class="cx" style="display: block; padding: 0 10px">          * @return array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected function fetch_data(&$cache)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1612,6 +1666,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                                $file = $this->registry->create('File', array($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                $this->status_code = $file->status_code;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                                if ($file->success)
</span><span class="cx" style="display: block; padding: 0 10px">                                                {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1666,6 +1721,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->status_code = $file->status_code;
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // If the file connection has an error, set SimplePie::error to that and quit
</span><span class="cx" style="display: block; padding: 0 10px">                if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
</span><span class="cx" style="display: block; padding: 0 10px">                {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1773,6 +1830,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Get the last HTTP status code
+        *
+        * @return int Status code
+        */
+       public function status_code()
+       {
+               return $this->status_code;
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Get the raw XML
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * This is the same as the old `$feed->enable_xml_dump(true)`, but returns
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2615,13 +2682,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if (isset($this->data['headers']['link']) &&
-                   preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/',
-                              $this->data['headers']['link'], $match))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if (isset($this->data['headers']['link']))
</ins><span class="cx" style="display: block; padding: 0 10px">                 {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return array($match[1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $link_headers = $this->data['headers']['link'];
+                       if (is_string($link_headers)) {
+                               $link_headers = array($link_headers);
+                       }
+                       $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers);
+                       if (!empty($matches)) {
+                               return $matches;
+                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                else if (isset($this->data['links'][$rel]))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               if (isset($this->data['links'][$rel]))
</ins><span class="cx" style="display: block; padding: 0 10px">                 {
</span><span class="cx" style="display: block; padding: 0 10px">                        return $this->data['links'][$rel];
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre>
</div>
</div>

</body>
</html>