<!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>[60771] trunk/src/wp-includes: External Libraries: Update the SimplePie library to version 1.9.0.</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/60771">60771</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/60771","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>2025-09-16 22:45:37 +0000 (Tue, 16 Sep 2025)</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.9.0.
References:
* [https://github.com/simplepie/simplepie/releases/tag/1.9.0 SimplePie 1.9.0 release notes]
* [https://github.com/simplepie/simplepie/compare/1.8.1...1.9.0 Full list of changes in SimplePie 1.9.0]
Follow-up to <a href="https://core.trac.wordpress.org/changeset/59141">[59141]</a>, <a href="https://core.trac.wordpress.org/changeset/60490">[60490]</a>.
Props swissspidy, TobiasBg, SergeyBiryukov.
Fixes <a href="https://core.trac.wordpress.org/ticket/63961">#63961</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesSimplePieautoloaderphp">trunk/src/wp-includes/SimplePie/autoloader.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieAuthorphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Author.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheBasephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Base.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheDBphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/DB.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheFilephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/File.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheMemcachephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheMemcachedphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcached.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheMySQLphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/MySQL.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCacheRedisphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Redis.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCachephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Cache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCaptionphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Caption.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCategoryphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Category.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieContentTypeSnifferphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Content/Type/Sniffer.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCopyrightphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Copyright.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCorephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Core.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieCreditphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Credit.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieDecodeHTMLEntitiesphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Decode/HTML/Entities.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieEnclosurephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Enclosure.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieExceptionphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Exception.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieFilephp">trunk/src/wp-includes/SimplePie/library/SimplePie/File.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieHTTPParserphp">trunk/src/wp-includes/SimplePie/library/SimplePie/HTTP/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieIRIphp">trunk/src/wp-includes/SimplePie/library/SimplePie/IRI.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieItemphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Item.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieLocatorphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Locator.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieMiscphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Misc.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieNetIPv6php">trunk/src/wp-includes/SimplePie/library/SimplePie/Net/IPv6.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieParseDatephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Parse/Date.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieParserphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieRatingphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Rating.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieRegistryphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Registry.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieRestrictionphp">trunk/src/wp-includes/SimplePie/library/SimplePie/Restriction.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieSanitizephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Sanitize.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieSourcephp">trunk/src/wp-includes/SimplePie/library/SimplePie/Source.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePieXMLDeclarationParserphp">trunk/src/wp-includes/SimplePie/library/SimplePie/XML/Declaration/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePiegzdecodephp">trunk/src/wp-includes/SimplePie/library/SimplePie/gzdecode.php</a></li>
<li><a href="#trunksrcwpincludesSimplePielibrarySimplePiephp">trunk/src/wp-includes/SimplePie/library/SimplePie.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcAuthorphp">trunk/src/wp-includes/SimplePie/src/Author.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheBasephp">trunk/src/wp-includes/SimplePie/src/Cache/Base.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheBaseDataCachephp">trunk/src/wp-includes/SimplePie/src/Cache/BaseDataCache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheCallableNameFilterphp">trunk/src/wp-includes/SimplePie/src/Cache/CallableNameFilter.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheDBphp">trunk/src/wp-includes/SimplePie/src/Cache/DB.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheDataCachephp">trunk/src/wp-includes/SimplePie/src/Cache/DataCache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheFilephp">trunk/src/wp-includes/SimplePie/src/Cache/File.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheMemcachephp">trunk/src/wp-includes/SimplePie/src/Cache/Memcache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheMemcachedphp">trunk/src/wp-includes/SimplePie/src/Cache/Memcached.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheMySQLphp">trunk/src/wp-includes/SimplePie/src/Cache/MySQL.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheNameFilterphp">trunk/src/wp-includes/SimplePie/src/Cache/NameFilter.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCachePsr16php">trunk/src/wp-includes/SimplePie/src/Cache/Psr16.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCacheRedisphp">trunk/src/wp-includes/SimplePie/src/Cache/Redis.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCachephp">trunk/src/wp-includes/SimplePie/src/Cache.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCaptionphp">trunk/src/wp-includes/SimplePie/src/Caption.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCategoryphp">trunk/src/wp-includes/SimplePie/src/Category.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcContentTypeSnifferphp">trunk/src/wp-includes/SimplePie/src/Content/Type/Sniffer.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCopyrightphp">trunk/src/wp-includes/SimplePie/src/Copyright.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcCreditphp">trunk/src/wp-includes/SimplePie/src/Credit.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcEnclosurephp">trunk/src/wp-includes/SimplePie/src/Enclosure.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcExceptionphp">trunk/src/wp-includes/SimplePie/src/Exception.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcFilephp">trunk/src/wp-includes/SimplePie/src/File.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcGzdecodephp">trunk/src/wp-includes/SimplePie/src/Gzdecode.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPParserphp">trunk/src/wp-includes/SimplePie/src/HTTP/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcIRIphp">trunk/src/wp-includes/SimplePie/src/IRI.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcItemphp">trunk/src/wp-includes/SimplePie/src/Item.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcLocatorphp">trunk/src/wp-includes/SimplePie/src/Locator.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcMiscphp">trunk/src/wp-includes/SimplePie/src/Misc.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcNetIPv6php">trunk/src/wp-includes/SimplePie/src/Net/IPv6.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcParseDatephp">trunk/src/wp-includes/SimplePie/src/Parse/Date.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcParserphp">trunk/src/wp-includes/SimplePie/src/Parser.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcRatingphp">trunk/src/wp-includes/SimplePie/src/Rating.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcRegistryphp">trunk/src/wp-includes/SimplePie/src/Registry.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcRegistryAwarephp">trunk/src/wp-includes/SimplePie/src/RegistryAware.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcRestrictionphp">trunk/src/wp-includes/SimplePie/src/Restriction.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcSanitizephp">trunk/src/wp-includes/SimplePie/src/Sanitize.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcSimplePiephp">trunk/src/wp-includes/SimplePie/src/SimplePie.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcSourcephp">trunk/src/wp-includes/SimplePie/src/Source.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcXMLDeclarationParserphp">trunk/src/wp-includes/SimplePie/src/XML/Declaration/Parser.php</a></li>
<li><a href="#trunksrcwpincludesclasswpsimplepiefilephp">trunk/src/wp-includes/class-wp-simplepie-file.php</a></li>
<li><a href="#trunksrcwpincludesfeedphp">trunk/src/wp-includes/feed.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPClientphp">trunk/src/wp-includes/SimplePie/src/HTTP/Client.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPClientExceptionphp">trunk/src/wp-includes/SimplePie/src/HTTP/ClientException.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPFileClientphp">trunk/src/wp-includes/SimplePie/src/HTTP/FileClient.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPPsr18Clientphp">trunk/src/wp-includes/SimplePie/src/HTTP/Psr18Client.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPPsr7Responsephp">trunk/src/wp-includes/SimplePie/src/HTTP/Psr7Response.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPRawTextResponsephp">trunk/src/wp-includes/SimplePie/src/HTTP/RawTextResponse.php</a></li>
<li><a href="#trunksrcwpincludesSimplePiesrcHTTPResponsephp">trunk/src/wp-includes/SimplePie/src/HTTP/Response.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/src/wp-includes/SimplePie/src/Decode/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesSimplePieautoloaderphp"></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/autoloader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/autoloader.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/autoloader.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,46 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</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"> * PSR-4 implementation for SimplePie.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,9 +54,6 @@
</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"> * Autoloader class
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Autoloader
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieAuthorphp"></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/library/SimplePie/Author.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Author.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Author.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Author;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Author');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Author" class is deprecated since SimplePie 1.7.0, use "SimplePie\Author" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Author" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Author extends Author
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheBasephp"></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/library/SimplePie/Cache/Base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Base.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Base.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Base;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> interface_exists('SimplePie\Cache\Base');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_Base" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Base" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Base" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> interface SimplePie_Cache_Base extends Base
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheDBphp"></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/library/SimplePie/Cache/DB.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/DB.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/DB.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\DB;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\DB');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_DB" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\DB" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\DB" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> abstract class SimplePie_Cache_DB extends DB
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheFilephp"></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/library/SimplePie/Cache/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/File.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/File.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\File;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\File');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_File" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\File" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\File" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache_File extends File
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheMemcachephp"></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/library/SimplePie/Cache/Memcache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Memcache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\Memcache');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_Memcache" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcache" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcache" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache_Memcache extends Memcache
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheMemcachedphp"></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/library/SimplePie/Cache/Memcached.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcached.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Memcached.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Memcached;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\Memcached');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_Memcached" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcached" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Memcached" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache_Memcached extends Memcached
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheMySQLphp"></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/library/SimplePie/Cache/MySQL.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/MySQL.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/MySQL.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\MySQL;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\MySQL');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_MySQL" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\MySQL" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\MySQL" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache_MySQL extends MySQL
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCacheRedisphp"></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/library/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/library/SimplePie/Cache/Redis.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache/Redis.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,15 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie Redis Cache Extension
- *
- * @package SimplePie
- * @author Jan Kozak <galvani78@gmail.com>
- * @link http://galvani.cz/
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version 0.2.9
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Redis;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache\Redis');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache_Redis" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Redis" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache\Redis" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache_Redis extends Redis
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCachephp"></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/library/SimplePie/Cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Cache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Cache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Cache');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Cache" class is deprecated since SimplePie 1.7.0, use "SimplePie\Cache" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Cache" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Cache extends Cache
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCaptionphp"></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/library/SimplePie/Caption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Caption.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Caption.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Caption;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Caption');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Caption" class is deprecated since SimplePie 1.7.0, use "SimplePie\Caption" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Caption" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Caption extends Caption
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCategoryphp"></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/library/SimplePie/Category.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Category.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Category.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Category;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Category');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Category" class is deprecated since SimplePie 1.7.0, use "SimplePie\Category" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Category" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Category extends Category
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieContentTypeSnifferphp"></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/library/SimplePie/Content/Type/Sniffer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Content/Type/Sniffer.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Content/Type/Sniffer.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Content\Type\Sniffer;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Content\Type\Sniffer');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Content_Type_Sniffer" class is deprecated since SimplePie 1.7.0, use "SimplePie\Content\Type\Sniffer" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Content\Type\Sniffer" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Content_Type_Sniffer extends Sniffer
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCopyrightphp"></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/library/SimplePie/Copyright.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Copyright.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Copyright.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Copyright;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Copyright');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Copyright" class is deprecated since SimplePie 1.7.0, use "SimplePie\Copyright" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Copyright" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Copyright extends Copyright
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCorephp"></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/library/SimplePie/Core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Core.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Core.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SimplePie class.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +11,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Class for backward compatibility.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use {@see SimplePie} directly
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Core extends SimplePie
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieCreditphp"></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/library/SimplePie/Credit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Credit.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Credit.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Credit;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Credit');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Credit" class is deprecated since SimplePie 1.7.0, use "SimplePie\Credit" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Credit" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Credit extends Credit
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieDecodeHTMLEntitiesphp"></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/library/SimplePie/Decode/HTML/Entities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Decode/HTML/Entities.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Decode/HTML/Entities.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,48 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
</ins><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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Decode HTML Entities
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +12,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * This implements HTML5 as of revision 967 (2007-06-28)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use DOMDocument instead!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Decode_HTML_Entities
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Input data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = $data;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,7 +58,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function parse()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while (($this->position = strpos($this->data, '&', $this->position)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (($position = strpos($this->data, '&', $this->position)) !== false) {
+ $this->position = $position;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->consume();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->entity();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->consumed = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Consume the next byte
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return mixed The next byte, or false, if there is no more data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false The next byte, or false, if there is no more data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function consume()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,9 +88,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $chars Characters to consume
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return mixed A series of characters that match the range, or false
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false A series of characters that match the range, or false
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function consume_range($chars)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function consume_range(string $chars)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($len = strspn($this->data, $chars, $this->position)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = substr($this->data, $this->position, $len);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,6 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Unconsume one byte
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function unconsume()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,6 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Decode an entity
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function entity()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,9 +152,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> static $windows_1252_specials = [0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE
2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ($hex) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $codepoint = hexdec($codepoint);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cap to PHP_INT_MAX to ensure consistent behaviour if $codepoint is so large
+ // it cannot fit into int – just casting float to int might return junk (e.g. a negative number).
+ // If it is so large, `Misc::codepoint_to_utf8` will just return a replacement character.
+ $codepoint = (int) min(hexdec($codepoint), \PHP_INT_MAX);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $codepoint = intval($codepoint);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Casting string to int caps at PHP_INT_MAX automatically.
+ $codepoint = (int) $codepoint;
</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"> if (isset($windows_1252_specials[$codepoint])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -579,7 +548,9 @@
</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"> for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $consumed = substr($this->consumed, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan on PHP < 8.0: We consumed as per the loop condition,
+ // so `$this->consumed` is non-empty and the substr offset is valid.
+ $consumed = (string) substr($this->consumed, 1);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isset($entities[$consumed])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $match = $consumed;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieEnclosurephp"></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/library/SimplePie/Enclosure.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Enclosure.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Enclosure.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Enclosure;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Enclosure');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Enclosure" class is deprecated since SimplePie 1.7.0, use "SimplePie\Enclosure" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Enclosure" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Enclosure extends Enclosure
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieExceptionphp"></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/library/SimplePie/Exception.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Exception.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Exception.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Exception as SimplePieException;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Exception');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Exception" class is deprecated since SimplePie 1.7.0, use "SimplePie\Exception" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Exception" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Exception extends SimplePieException
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieFilephp"></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/library/SimplePie/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/File.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/File.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\File;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\File');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_File" class is deprecated since SimplePie 1.7.0, use "SimplePie\File" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\File" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_File extends File
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieHTTPParserphp"></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/library/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/library/SimplePie/HTTP/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/HTTP/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\HTTP\Parser;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\HTTP\Parser');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +11,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_HTTP_Parser" class is deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead
+ * @template Psr7Compatible of bool
+ * @extends Parser<Psr7Compatible>
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_HTTP_Parser extends Parser
</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="trunksrcwpincludesSimplePielibrarySimplePieIRIphp"></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/library/SimplePie/IRI.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/IRI.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/IRI.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\IRI;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\IRI');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_IRI" class is deprecated since SimplePie 1.7.0, use "SimplePie\IRI" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\IRI" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_IRI extends IRI
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieItemphp"></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/library/SimplePie/Item.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Item.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Item.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Item;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Item');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Item" class is deprecated since SimplePie 1.7.0, use "SimplePie\Item" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Item" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Item extends Item
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieLocatorphp"></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/library/SimplePie/Locator.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Locator.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Locator.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Locator;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Locator');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Locator" class is deprecated since SimplePie 1.7.0, use "SimplePie\Locator" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Locator" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Locator extends Locator
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieMiscphp"></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/library/SimplePie/Misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Misc.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Misc.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Misc;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Misc');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Misc" class is deprecated since SimplePie 1.7.0, use "SimplePie\Misc" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Misc" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Misc extends Misc
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieNetIPv6php"></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/library/SimplePie/Net/IPv6.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Net/IPv6.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Net/IPv6.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Net\IPv6;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Net\IPv6');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Net_IPv6" class is deprecated since SimplePie 1.7.0, use "SimplePie\Net\IPv6" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Net\IPv6" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Net_IPv6 extends IPv6
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieParseDatephp"></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/library/SimplePie/Parse/Date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Parse/Date.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Parse/Date.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Parse\Date;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Parse\Date');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Parse_Date" class is deprecated since SimplePie 1.7.0, use "SimplePie\Parse\Date" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Parse\Date" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Parse_Date extends Date
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieParserphp"></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/library/SimplePie/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Parser;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Parser');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Parser" class is deprecated since SimplePie 1.7.0, use "SimplePie\Parser" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Parser" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Parser extends Parser
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieRatingphp"></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/library/SimplePie/Rating.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Rating.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Rating.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Rating;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Rating');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Rating" class is deprecated since SimplePie 1.7.0, use "SimplePie\Rating" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Rating" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Rating extends Rating
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieRegistryphp"></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/library/SimplePie/Registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Registry.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Registry.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Registry;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Registry');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Registry" class is deprecated since SimplePie 1.7.0, use "SimplePie\Registry" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Registry" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Registry extends Registry
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieRestrictionphp"></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/library/SimplePie/Restriction.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Restriction.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Restriction.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Restriction;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Restriction');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Restriction" class is deprecated since SimplePie 1.7.0, use "SimplePie\Restriction" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Restriction" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Restriction extends Restriction
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieSanitizephp"></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/library/SimplePie/Sanitize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Sanitize.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Sanitize.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Sanitize;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Sanitize');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Sanitize" class is deprecated since SimplePie 1.7.0, use "SimplePie\Sanitize" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Sanitize" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Sanitize extends Sanitize
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieSourcephp"></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/library/SimplePie/Source.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/Source.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/Source.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Source;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Source');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_Source" class is deprecated since SimplePie 1.7.0, use "SimplePie\Source" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Source" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_Source extends Source
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePieXMLDeclarationParserphp"></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/library/SimplePie/XML/Declaration/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/XML/Declaration/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/XML/Declaration/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\XML\Declaration\Parser;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\XML\Declaration\Parser');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_XML_Declaration_Parser" class is deprecated since SimplePie 1.7.0, use "SimplePie\XML\Declaration\Parser" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\XML\Declaration\Parser" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_XML_Declaration_Parser extends Parser
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePiegzdecodephp"></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/library/SimplePie/gzdecode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie/gzdecode.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie/gzdecode.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Gzdecode;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\Gzdecode');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie_gzdecode" class is deprecated since SimplePie 1.7.0, use "SimplePie\Gzdecode" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\Gzdecode" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie_gzdecode extends Gzdecode
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePielibrarySimplePiephp"></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/library/SimplePie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/library/SimplePie.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/library/SimplePie.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,48 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2017, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @version 1.7.0
- * @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\SimplePie as NamespacedSimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class_exists('SimplePie\SimplePie');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,6 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Using the "SimplePie" class is deprecated since SimplePie 1.7.0, use "SimplePie\SimplePie" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** @phpstan-ignore-next-line */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (\false) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** @deprecated since SimplePie 1.7.0, use "SimplePie\SimplePie" instead */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie extends NamespacedSimplePie
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcAuthorphp"></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/src/Author.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Author.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Author.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see Item::get_author()} and {@see SimplePie::get_authors()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see SimplePie::set_author_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Author
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Author's name
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_name()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Author's link
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_link()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $link;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Author's email address
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_email()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $email;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,13 +42,12 @@
</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"> * Constructor, used to input the data
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @param string $name
- * @param string $link
- * @param string $email
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($name = null, $link = null, $email = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $name = null,
+ ?string $link = null,
+ ?string $email = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->name = $name;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->link = $link;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->email = $email;
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheBasephp"></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/src/Cache/Base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/Base.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/Base.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</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">@@ -50,8 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Classes to be used with {@see \SimplePie\Cache::register()} are expected
</span><span class="cx" style="display: block; padding: 0 10px"> * to implement this interface.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> interface Base
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,12 +38,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $type);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $type);
</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"> * Save data to the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the data saved to the cache
</span><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 Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<mixed> Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheBaseDataCachephp"></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/src/Cache/BaseDataCache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/BaseDataCache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/BaseDataCache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use InvalidArgumentException;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,8 +12,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Adapter for deprecated \SimplePie\Cache\Base implementations
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @internal
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> final class BaseDataCache implements DataCache
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * </code>
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key The key of the item to store.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $value The value of the item to store, must be serializable.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $value The value of the item to store, must be serializable.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and
</span><span class="cx" style="display: block; padding: 0 10px"> * the driver supports TTL then the library may set a default value
</span><span class="cx" style="display: block; padding: 0 10px"> * for it or let the driver take care of that.
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheCallableNameFilterphp"></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/src/Cache/CallableNameFilter.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/CallableNameFilter.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/CallableNameFilter.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,61 +1,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</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"> * Creating a cache filename with callables
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> final class CallableNameFilter implements NameFilter
</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">- * @var callable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var callable(string): string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private $callable;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param callable(string): string $callable
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function __construct(callable $callable)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->callable = $callable;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * and encodings or longer lengths, but MUST support at least that
</span><span class="cx" style="display: block; padding: 0 10px"> * minimum.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name The name for the cache will be most likly an url with query string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name The name for the cache will be most likely an url with query string
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string the new cache name
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheDBphp"></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/src/Cache/DB.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/DB.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/DB.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use SimplePie\Item;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Base class for database-based caches
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> abstract class DB implements Base
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,9 +22,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Converts a given {@see SimplePie} object into data to be stored
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param \SimplePie\SimplePie $data
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array First item is the serialized data for storage, second item is the unique ID for this item
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array{string, array<string, Item>} First item is the serialized data for storage, second item is the unique ID for this item
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected static function prepare_simplepie_object_for_cache($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected static function prepare_simplepie_object_for_cache(\SimplePie\SimplePie $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $items = $data->get_items();
</span><span class="cx" style="display: block; padding: 0 10px"> $items_by_id = [];
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheDataCachephp"></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/src/Cache/DataCache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/DataCache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/DataCache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use InvalidArgumentException;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,8 +18,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The methods names must be different, but should be compatible to the
</span><span class="cx" style="display: block; padding: 0 10px"> * methods of \Psr\SimpleCache\CacheInterface.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @internal
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> interface DataCache
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * </code>
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key The key of the item to store.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $value The value of the item to store, must be serializable.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $value The value of the item to store, must be serializable.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and
</span><span class="cx" style="display: block; padding: 0 10px"> * the driver supports TTL then the library may set a default value
</span><span class="cx" style="display: block; padding: 0 10px"> * for it or let the driver take care of that.
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheFilephp"></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/src/Cache/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/File.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/File.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</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"> * Caches data to the filesystem
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class File implements Base
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->location = $location;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->filename = $name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save data to the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,12 +80,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the data saved to the cache
</span><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 Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<mixed>|false Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (file_exists($this->name) && is_readable($this->name)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return unserialize(file_get_contents($this->name));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return unserialize((string) file_get_contents($this->name));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the last modified time for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function mtime()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheMemcachephp"></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/src/Cache/Memcache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/Memcache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/Memcache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use Memcache as NativeMemcache;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,8 +18,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * connect to memcache on `localhost` on port 11211. All tables will be
</span><span class="cx" style="display: block; padding: 0 10px"> * prefixed with `sp_` and data will expire after 3600 seconds
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @uses Memcache
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Memcache instance
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var Memcache
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var NativeMemcache
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * 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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->options = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'host' => '127.0.0.1',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save data to the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +86,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the data saved to the cache
</span><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 Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<mixed>|false Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the last modified time for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function mtime()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheMemcachedphp"></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/src/Cache/Memcached.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/Memcached.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/Memcached.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-FileCopyrightText: 2015 Paul L. McNeely
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use Memcached as NativeMemcached;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,9 +19,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * connect to memcached on `localhost` on port 11211. All tables will be
</span><span class="cx" style="display: block; padding: 0 10px"> * prefixed with `sp_` and data will expire after 3600 seconds
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
- * @author Paul L. McNeely
</del><span class="cx" style="display: block; padding: 0 10px"> * @uses Memcached
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +32,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"> * Options
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->options = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'host' => '127.0.0.1',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +68,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"> * Save data to the cache
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +82,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"> * Retrieve the data saved to the cache
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<mixed>|false Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,9 +125,10 @@
</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"> * Set the last modified time and data to NativeMemcached
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|false $data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Success status
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function setData($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function setData($data): bool
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($data !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheMySQLphp"></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/src/Cache/MySQL.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/MySQL.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/MySQL.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</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">@@ -53,8 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * connect to the `mydb` database on `localhost` on port 3306, with the user
</span><span class="cx" style="display: block; padding: 0 10px"> * `root` and the password `password`. All tables will be prefixed with `sp_`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class MySQL extends DB
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * PDO instance
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var \PDO
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var \PDO|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $mysql;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * 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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->options = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'user' => null,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save data to the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +229,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the data saved to the cache
</span><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 Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string>|false Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,7 +271,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $query->bindValue(':feed', $this->id);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($query->execute()) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ($row = $query->fetchColumn()) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $feed['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'][] = unserialize($row);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $feed['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'][] = unserialize((string) $row);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the last modified time for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function mtime()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +297,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
</span><span class="cx" style="display: block; padding: 0 10px"> $query->bindValue(':id', $this->id);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($query->execute() && ($time = $query->fetchColumn())) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $time;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (int) $time;
</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"> return false;
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheNameFilterphp"></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/src/Cache/NameFilter.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/NameFilter.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/NameFilter.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,53 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</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"> * Interface for creating a cache filename
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> interface NameFilter
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * and encodings or longer lengths, but MUST support at least that
</span><span class="cx" style="display: block; padding: 0 10px"> * minimum.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name The name for the cache will be most likly an url with query string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name The name for the cache will be most likely an url with query string
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string the new cache name
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCachePsr16php"></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/src/Cache/Psr16.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/Psr16.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/Psr16.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,57 +1,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use Psr\SimpleCache\CacheInterface;
</span><span class="cx" style="display: block; padding: 0 10px"> use Psr\SimpleCache\InvalidArgumentException;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Throwable;
</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"> * Caches data into a PSR-16 cache implementation
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @internal
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> final class Psr16 implements DataCache
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|mixed The value of the item from the cache, or $default in case of cache miss.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @throws InvalidArgumentException
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @throws InvalidArgumentException&Throwable
</ins><span class="cx" style="display: block; padding: 0 10px"> * MUST be thrown if the $key string is not a legal value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_data(string $key, $default = null)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * </code>
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key The key of the item to store.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $value The value of the item to store, must be serializable.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $value The value of the item to store, must be serializable.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and
</span><span class="cx" style="display: block; padding: 0 10px"> * the driver supports TTL then the library may set a default value
</span><span class="cx" style="display: block; padding: 0 10px"> * for it or let the driver take care of that.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success and false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @throws InvalidArgumentException
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @throws InvalidArgumentException&Throwable
</ins><span class="cx" style="display: block; padding: 0 10px"> * MUST be thrown if the $key string is not a legal value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_data(string $key, array $value, ?int $ttl = null): bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if the item was successfully removed. False if there was an error.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @throws InvalidArgumentException
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @throws InvalidArgumentException&Throwable
</ins><span class="cx" style="display: block; padding: 0 10px"> * MUST be thrown if the $key string is not a legal value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function delete_data(string $key): bool
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCacheRedisphp"></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/src/Cache/Redis.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache/Redis.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache/Redis.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-FileCopyrightText: 2015 Jan Kozak <galvani78@gmail.com>
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Cache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use Redis as NativeRedis;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,8 +19,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * connect to redis on `localhost` on port 6379. All tables will be
</span><span class="cx" style="display: block; padding: 0 10px"> * prefixed with `simple_primary-` and data will expire after 3600 seconds
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @uses Redis
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * 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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,9 +50,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $location Location string (from SimplePie::$cache_location)
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Unique ID for the cache
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param Base::TYPE_FEED|Base::TYPE_IMAGE|array<string, mixed>|null $options Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($location, $name, $options = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $location, string $name, $options = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> //$this->cache = \flow\simple\cache\Redis::getRedisClientInstance();
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed = \SimplePie\Cache::parse_URL($location);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,6 +80,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"> * @param NativeRedis $cache
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function setRedisClient(NativeRedis $cache)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save data to the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function save($data)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the data saved to the cache
</span><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 Data for SimplePie::$data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<mixed>|false Data for SimplePie::$data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function load()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the last modified time for the cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function mtime()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCachephp"></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/src/Cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Cache.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Cache.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Base;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,8 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * although the preferred way is to create your own handler
</span><span class="cx" style="display: block; padding: 0 10px"> * via {@see register()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage Caching
</del><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use "SimplePie\SimplePie::set_cache()" instead
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Cache
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,13 +25,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * These receive 3 parameters to their constructor, as documented in
</span><span class="cx" style="display: block; padding: 0 10px"> * {@see register()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, class-string<Base>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected static $handlers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'mysql' => 'SimplePie\Cache\MySQL',
- 'memcache' => 'SimplePie\Cache\Memcache',
- 'memcached' => 'SimplePie\Cache\Memcached',
- 'redis' => 'SimplePie\Cache\Redis'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'mysql' => Cache\MySQL::class,
+ 'memcache' => Cache\Memcache::class,
+ 'memcached' => Cache\Memcached::class,
+ 'redis' => Cache\Redis::class,
</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">@@ -88,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc'
</span><span class="cx" style="display: block; padding: 0 10px"> * @return Base Type of object depends on scheme of `$location`
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function get_handler($location, $filename, $extension)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function get_handler(string $location, string $filename, $extension)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = explode(':', $location, 2);
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $type[0];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,8 +65,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Create a new SimplePie\Cache object
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $location
+ * @param string $filename
+ * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension
+ * @return Base
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function create($location, $filename, $extension)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function create(string $location, string $filename, $extension)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error('Cache::create() has been replaced with Cache::get_handler() since SimplePie 1.3.1, use the registry system instead.', \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,8 +82,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $type DSN type to register for
</span><span class="cx" style="display: block; padding: 0 10px"> * @param class-string<Base> $class Name of handler class. Must implement Base
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function register($type, $class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function register(string $type, $class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> self::$handlers[$type] = $class;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,12 +93,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse a URL into an array
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function parse_URL($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function parse_URL(string $url)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $params = parse_url($url);
- $params['extras'] = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsedUrl = parse_url($url);
+
+ if ($parsedUrl === false) {
+ return [];
+ }
+
+ $params = array_merge($parsedUrl, ['extras' => []]);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isset($params['query'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> parse_str($params['query'], $params['extras']);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCaptionphp"></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/src/Caption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Caption.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Caption.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Enclosure::get_caption()} and {@see \SimplePie\Enclosure::get_captions()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_caption_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Caption
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Content type
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_type()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Language
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_language()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $lang;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Start time
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_starttime()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $startTime;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * End time
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_endtime()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $endTime;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Caption text
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_text()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $text;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,8 +62,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $type = null,
+ ?string $lang = null,
+ ?string $startTime = null,
+ ?string $endTime = null,
+ ?string $text = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->type = $type;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->lang = $lang;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->startTime = $startTime;
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCategoryphp"></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/src/Category.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Category.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Category.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Item::get_category()} and {@see \SimplePie\Item::get_categories()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_category_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Category
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $label
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $type
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($term = null, $scheme = null, $label = null, $type = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(?string $term = null, ?string $scheme = null, ?string $label = null, ?string $type = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->term = $term;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->scheme = $scheme;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $strict
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_label($strict = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_label(bool $strict = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->label === null && $strict !== true) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->get_term();
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcContentTypeSnifferphp"></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/src/Content/Type/Sniffer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Content/Type/Sniffer.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Content/Type/Sniffer.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,49 +1,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Content\Type;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use InvalidArgumentException;
+use SimplePie\File;
+use SimplePie\HTTP\Response;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Content-type sniffing
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,9 +21,6 @@
</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"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_content_type_sniffer_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage HTTP
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Sniffer
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * File object
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var \SimplePie\File
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var File|Response
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $file;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,10 +34,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create an instance of the class with the input file
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param Sniffer $file Input file
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param File|Response $file Input file
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($file)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(/* File */ $file)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!is_object($file) || !$file instanceof Response) {
+ // For BC we're asking for `File`, but internally we accept every `Response` implementation
+ throw new InvalidArgumentException(sprintf(
+ '%s(): Argument #1 ($file) must be of type %s',
+ __METHOD__,
+ File::class
+ ), 1);
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->file = $file;
</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">@@ -84,19 +57,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_type()
</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->file->headers['content-type'])) {
- if (!isset($this->file->headers['content-encoding'])
- && ($this->file->headers['content-type'] === 'text/plain'
- || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
- || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
- || $this->file->headers['content-type'] === 'text/plain; charset=UTF-8')) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content_type = $this->file->has_header('content-type') ? $this->file->get_header_line('content-type') : null;
+ $content_encoding = $this->file->has_header('content-encoding') ? $this->file->get_header_line('content-encoding') : null;
+ if ($content_type !== null) {
+ if ($content_encoding === null
+ && ($content_type === 'text/plain'
+ || $content_type === 'text/plain; charset=ISO-8859-1'
+ || $content_type === 'text/plain; charset=iso-8859-1'
+ || $content_type === 'text/plain; charset=UTF-8')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->text_or_binary();
</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 (($pos = strpos($this->file->headers['content-type'], ';')) !== false) {
- $official = substr($this->file->headers['content-type'], 0, $pos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($pos = strpos($content_type, ';')) !== false) {
+ $official = substr($content_type, 0, $pos);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $official = $this->file->headers['content-type'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $official = $content_type;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $official = trim(strtolower($official));
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,12 +105,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function text_or_binary()
</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 (substr($this->file->body, 0, 2) === "\xFE\xFF"
- || substr($this->file->body, 0, 2) === "\xFF\xFE"
- || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF"
- || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = $this->file->get_body_content();
+
+ if (substr($body, 0, 2) === "\xFE\xFF"
+ || substr($body, 0, 2) === "\xFF\xFE"
+ || substr($body, 0, 4) === "\x00\x00\xFE\xFF"
+ || substr($body, 0, 3) === "\xEF\xBB\xBF") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'text/plain';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $body)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'application/octet-stream';
</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">@@ -149,25 +126,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function unknown()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20");
- if (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html'
- || strtolower(substr($this->file->body, $ws, 5)) === '<html'
- || strtolower(substr($this->file->body, $ws, 7)) === '<script') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = $this->file->get_body_content();
+
+ $ws = strspn($body, "\x09\x0A\x0B\x0C\x0D\x20");
+ if (strtolower(substr($body, $ws, 14)) === '<!doctype html'
+ || strtolower(substr($body, $ws, 5)) === '<html'
+ || strtolower(substr($body, $ws, 7)) === '<script') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 5) === '%PDF-') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 5) === '%PDF-') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'application/pdf';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 11) === '%!PS-Adobe-') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'application/postscript';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 6) === 'GIF87a'
- || substr($this->file->body, 0, 6) === 'GIF89a') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 6) === 'GIF87a'
+ || substr($body, 0, 6) === 'GIF89a') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/gif';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/png';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 3) === "\xFF\xD8\xFF") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/jpeg';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 2) === "\x42\x4D") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/bmp';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 4) === "\x00\x00\x01\x00") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/vnd.microsoft.icon';
</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">@@ -177,20 +156,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Sniff images
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string Actual Content-Type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false Actual Content-Type
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function image()
</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 (substr($this->file->body, 0, 6) === 'GIF87a'
- || substr($this->file->body, 0, 6) === 'GIF89a') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = $this->file->get_body_content();
+
+ if (substr($body, 0, 6) === 'GIF87a'
+ || substr($body, 0, 6) === 'GIF89a') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/gif';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/png';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 3) === "\xFF\xD8\xFF") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/jpeg';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 2) === "\x42\x4D") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/bmp';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, 0, 4) === "\x00\x00\x01\x00") {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'image/vnd.microsoft.icon';
</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">@@ -204,16 +185,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function feed_or_html()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $len = strlen($this->file->body);
- $pos = strspn($this->file->body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = $this->file->get_body_content();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $len = strlen($body);
+ $pos = strspn($body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");
+
</ins><span class="cx" style="display: block; padding: 0 10px"> while ($pos < $len) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch ($this->file->body[$pos]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ($body[$pos]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case "\x09":
</span><span class="cx" style="display: block; padding: 0 10px"> case "\x0A":
</span><span class="cx" style="display: block; padding: 0 10px"> case "\x0D":
</span><span class="cx" style="display: block; padding: 0 10px"> case "\x20":
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pos += strspn($body, "\x09\x0A\x0D\x20", $pos);
</ins><span class="cx" style="display: block; padding: 0 10px"> continue 2;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case '<':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,29 +207,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</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 (substr($this->file->body, $pos, 3) === '!--') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (substr($body, $pos, 3) === '!--') {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pos += 3;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($pos < $len && ($pos = strpos($body, '-->', $pos)) !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pos += 3;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, $pos, 1) === '!') {
- if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, $pos, 1) === '!') {
+ if ($pos < $len && ($pos = strpos($body, '>', $pos)) !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pos++;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, $pos, 1) === '?') {
- if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, $pos, 1) === '?') {
+ if ($pos < $len && ($pos = strpos($body, '?>', $pos)) !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pos += 2;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, $pos, 3) === 'rss'
- || substr($this->file->body, $pos, 7) === 'rdf:RDF') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, $pos, 3) === 'rss'
+ || substr($body, $pos, 7) === 'rdf:RDF') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'application/rss+xml';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($this->file->body, $pos, 4) === 'feed') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr($body, $pos, 4) === 'feed') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 'application/atom+xml';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'text/html';
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCopyrightphp"></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/src/Copyright.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Copyright.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Copyright.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Enclosure::get_copyright()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_copyright_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Copyright
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Copyright URL
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_url()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $url;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Attribution
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_attribution()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $label;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,8 +38,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($url = null, $label = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $url = null,
+ ?string $label = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->url = $url;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->label = $label;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcCreditphp"></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/src/Credit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Credit.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Credit.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Enclosure::get_credit()} and {@see \SimplePie\Enclosure::get_credits()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_credit_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Credit
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Credited role
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_role()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $role;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Organizational 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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_scheme()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $scheme;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Credited name
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_name()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,8 +46,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($role = null, $scheme = null, $name = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $role = null,
+ ?string $scheme = null,
+ ?string $name = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->role = $role;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->scheme = $scheme;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->name = $name;
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcEnclosurephp"></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/src/Enclosure.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Enclosure.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Enclosure.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,86 +13,83 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Item::get_enclosure()} and {@see \SimplePie\Item::get_enclosures()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_enclosure_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Enclosure
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_bitrate()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $bitrate;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Caption[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_captions()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $captions;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Category[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $categories;
</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">- * @var int
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?int
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_channels()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $channels;
</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">- * @var \SimplePie\Copyright
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?Copyright
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_copyright()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $copyright;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Credit[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_credits()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $credits;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_description()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $description;
</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">- * @var int
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?int
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_duration()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $duration;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_expression()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $expression;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_framerate()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $framerate;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_handler()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $handler;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_hashes()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $hashes;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_height()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $height;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,79 +101,79 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $javascript;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_keywords()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $keywords;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_language()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $lang;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?int
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_length()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $length;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_link()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $link;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_medium()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $medium;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_player()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $player;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Rating[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_ratings()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $ratings;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?Restriction[]
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_restrictions()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $restrictions;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_sampling_rate()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $samplingrate;
</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">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_thumbnails()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $thumbnails;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_title()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $title;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_type()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $type;
</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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_width()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $width;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,10 +184,46 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @uses idna_convert If available, this will convert an IDN
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @uses idn_to_ascii If available, this will convert an IDN
+ *
+ * @param null $javascript
+ * @param Caption[]|null $captions
+ * @param Category[]|null $categories
+ * @param Credit[]|null $credits
+ * @param string[]|null $hashes
+ * @param string[]|null $keywords
+ * @param Rating[]|null $ratings
+ * @param Restriction[]|null $restrictions
+ * @param string[]|null $thumbnails
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $link = null,
+ ?string $type = null,
+ ?int $length = null,
+ $javascript = null,
+ ?string $bitrate = null,
+ ?array $captions = null,
+ ?array $categories = null,
+ ?int $channels = null,
+ ?Copyright $copyright = null,
+ ?array $credits = null,
+ ?string $description = null,
+ ?int $duration = null,
+ ?string $expression = null,
+ ?string $framerate = null,
+ ?array $hashes = null,
+ ?string $height = null,
+ ?array $keywords = null,
+ ?string $lang = null,
+ ?string $medium = null,
+ ?string $player = null,
+ ?array $ratings = null,
+ ?array $restrictions = null,
+ ?string $samplingrate = null,
+ ?array $thumbnails = null,
+ ?string $title = null,
+ ?string $width = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->bitrate = $bitrate;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->captions = $captions;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->categories = $categories;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,10 +250,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->type = $type;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->width = $width;
</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('idna_convert')) {
- $idn = new \idna_convert();
- $parsed = \SimplePie\Misc::parse_url($link);
- $this->link = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (function_exists('idn_to_ascii')) {
+ $parsed = \SimplePie\Misc::parse_url($link ?? '');
+ if ($parsed['authority'] !== '' && !ctype_print($parsed['authority'])) {
+ $authority = (string) \idn_to_ascii($parsed['authority'], \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46);
+ $this->link = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $authority, $parsed['path'], $parsed['query'], $parsed['fragment']);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->handler = $this->get_handler(); // Needs to load last
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,7 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Caption|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_caption($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_caption(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $captions = $this->get_captions();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($captions[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all captions
</span><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|null Array of {@see \SimplePie\Caption} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Caption[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_captions()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,7 +321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Category|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_category($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_category(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = $this->get_categories();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($categories[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all categories
</span><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|null Array of {@see \SimplePie\Category} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return \SimplePie\Category[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,7 +379,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Credit|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_credit($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_credit(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $credits = $this->get_credits();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($credits[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,7 +392,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all credits
</span><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|null Array of {@see \SimplePie\Credit} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Credit[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_credits()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $convert Convert seconds into hh:mm:ss
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_duration($convert = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_duration(bool $convert = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->duration !== null) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($convert) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -500,7 +498,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null Hash as per `media:hash`, prefixed with "$algo:"
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_hash($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_hash(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $hashes = $this->get_hashes();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($hashes[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -513,7 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all credits
</span><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|null Array of strings, see {@see get_hash()}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string[]|null Array of strings, see {@see get_hash()}
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_hashes()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,7 +557,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_keyword($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_keyword(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $keywords = $this->get_keywords();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($keywords[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,7 +570,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all keywords
</span><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|null Array of strings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_keywords()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -586,7 +584,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get 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">- * @return float Length in bytes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ?int Length in bytes
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_length()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,7 +645,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Rating|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_rating($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_rating(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $ratings = $this->get_ratings();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($ratings[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -660,7 +658,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all ratings
</span><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|null Array of {@see \SimplePie\Rating} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Rating[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_ratings()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -677,7 +675,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Restriction|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_restriction($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_restriction(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $restrictions = $this->get_restrictions();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($restrictions[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -690,7 +688,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all restrictions
</span><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|null Array of {@see \SimplePie\Restriction} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Restriction[]|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_restrictions()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -736,7 +734,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null Thumbnail URL
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_thumbnail($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_thumbnail(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnails = $this->get_thumbnails();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($thumbnails[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,7 +747,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get all thumbnails
</span><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|null Array of thumbnail URLs
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string[]|null Array of thumbnail URLs
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_thumbnails()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -808,7 +806,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use the second parameter to {@see embed} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $options See first parameter to {@see embed}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, mixed>|string $options See first parameter to {@see embed}
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML string to output
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function native_embed($options = '')
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -857,11 +855,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * `width` and `height` set to `auto` will default to 480x270 video resolution.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $options Comma-separated key:value list, or array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, mixed>|string $options Comma-separated key:value list, or array
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $native Use `<embed>`
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML string to output
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function embed($options = '', $native = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function embed($options = '', bool $native = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Set up defaults
</span><span class="cx" style="display: block; padding: 0 10px"> $audio = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -933,7 +931,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $mime = explode('/', $type, 2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $mime = explode('/', (string) $type, 2);
</ins><span class="cx" style="display: block; padding: 0 10px"> $mime = $mime[0];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Process values for 'auto'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,7 +992,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Flash Media Player file types.
</span><span class="cx" style="display: block; padding: 0 10px"> // Preferred handler for MP3 file types.
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $height += 20;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (is_numeric($height)) {
+ $height += 20;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($native) {
</span><span class="cx" style="display: block; padding: 0 10px"> $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1005,7 +1006,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // QuickTime 7 file types. Need to test with QuickTime 6.
</span><span class="cx" style="display: block; padding: 0 10px"> // Only handle MP3's if the Flash Media Player is not present.
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $height += 16;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (is_numeric($height)) {
+ $height += 16;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($native) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($placeholder !== '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1019,7 +1023,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Windows Media
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ($handler === 'wmedia') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $height += 45;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (is_numeric($height)) {
+ $height += 45;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($native) {
</span><span class="cx" style="display: block; padding: 0 10px"> $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1044,9 +1051,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_type()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $find_handler Internal use only, use {@see get_handler()} instead
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string MIME type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|null MIME type
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_real_type($find_handler = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_real_type(bool $find_handler = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Mime-types by handler.
</span><span class="cx" style="display: block; padding: 0 10px"> $types_flash = ['application/x-shockwave-flash', 'application/futuresplash']; // Flash
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1055,10 +1062,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $types_wmedia = ['application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx']; // Windows Media
</span><span class="cx" style="display: block; padding: 0 10px"> $types_mp3 = ['audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg']; // 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">- if ($this->get_type() !== null) {
- $type = strtolower($this->type);
- } else {
- $type = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type = $this->get_type();
+ if ($type !== null) {
+ $type = strtolower($type);
</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"> // If we encounter an unsupported mime-type, check the file extension and guess intelligently.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1114,9 +1120,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = 'audio/x-ms-wma';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Video mime-types
</del><span class="cx" style="display: block; padding: 0 10px"> case '3gp':
</span><span class="cx" style="display: block; padding: 0 10px"> case '3gpp':
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Video mime-types
</ins><span class="cx" style="display: block; padding: 0 10px"> $type = 'video/3gpp';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1177,8 +1183,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = 'video/x-ms-wvx';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'spl':
</ins><span class="cx" style="display: block; padding: 0 10px"> // Flash mime-types
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'spl':
</del><span class="cx" style="display: block; padding: 0 10px"> $type = 'application/futuresplash';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcExceptionphp"></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/src/Exception.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Exception.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Exception.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use Exception as NativeException;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +11,6 @@
</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"> * General SimplePie exception class
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Exception extends NativeException
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcFilephp"></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/src/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/File.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/File.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,49 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use SimplePie\HTTP\Response;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Used for fetching remote files and reading local files
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,36 +16,93 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_file_class()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage HTTP
</del><span class="cx" style="display: block; padding: 0 10px"> * @todo Move to properly supporting RFC2616 (HTTP/1.1)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-class File
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+class File implements Response
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @var string The final URL after following all redirects
+ * @deprecated Use `get_final_requested_uri()` method.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $url;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @var ?string User agent to use in requests
+ * @deprecated Set the user agent in constructor.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $useragent;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $success = true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /** @var array<string, non-empty-array<string>> Canonical representation of headers */
+ private $parsed_headers = [];
+ /** @var array<string, string> Last known value of $headers property (used to detect external modification) */
+ private $last_headers = [];
+ /**
+ * @var array<string, string> Headers as string for BC
+ * @deprecated Use `get_headers()` method.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $headers = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @var ?string Body of the HTTP response
+ * @deprecated Use `get_body_content()` method.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $body;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @var int Status code of the HTTP response
+ * @deprecated Use `get_status_code()` method.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $status_code = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /** @var non-negative-int Number of redirect that were already performed during this request sequence. */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $redirects = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /** @var ?string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $error;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @var int-mask-of<SimplePie::FILE_SOURCE_*> Bit mask representing the method used to fetch the file and whether it is a local file or remote file obtained over HTTP.
+ * @deprecated Backend is implementation detail which you should not care about; to see if the file was retrieved over HTTP, check if `get_final_requested_uri()` with `Misc::is_remote_uri()`.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $method = \SimplePie\SimplePie::FILE_SOURCE_NONE;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @var string The permanent URL or the resource (first URL after the prefix of (only) permanent redirects)
+ * @deprecated Use `get_permanent_uri()` method.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $permanent_url;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool Whether the permanent URL is still writeable (prefix of permanent redirects has not ended) */
+ private $permanentUrlMutable = true;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false, $curl_options = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $url
+ * @param int $timeout
+ * @param int $redirects
+ * @param ?array<string, string> $headers
+ * @param ?string $useragent
+ * @param bool $force_fsockopen
+ * @param array<int, mixed> $curl_options
+ */
+ public function __construct(string $url, int $timeout = 10, int $redirects = 5, ?array $headers = null, ?string $useragent = null, bool $force_fsockopen = false, array $curl_options = [])
</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 (class_exists('idna_convert')) {
- $idn = new \idna_convert();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (function_exists('idn_to_ascii')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $parsed = \SimplePie\Misc::parse_url($url);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($parsed['authority'] !== '' && !ctype_print($parsed['authority'])) {
+ $authority = (string) \idn_to_ascii($parsed['authority'], \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46);
+ $url = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $authority, $parsed['path'], $parsed['query'], null);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->url = $url;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->permanent_url = $url;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->permanentUrlMutable) {
+ $this->permanent_url = $url;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->useragent = $useragent;
</span><span class="cx" style="display: block; padding: 0 10px"> if (preg_match('/^http(s)?:\/\//i', $url)) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($useragent === null) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $useragent = ini_get('user_agent');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $useragent = (string) ini_get('user_agent');
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->useragent = $useragent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_array($headers)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,6 +115,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($headers as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> $headers2[] = "$key: $value";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isset($curl_options[CURLOPT_HTTPHEADER])) {
+ if (is_array($curl_options[CURLOPT_HTTPHEADER])) {
+ $headers2 = array_merge($headers2, $curl_options[CURLOPT_HTTPHEADER]);
+ }
+ unset($curl_options[CURLOPT_HTTPHEADER]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (version_compare(\SimplePie\Misc::get_curl_version(), '7.10.5', '>=')) {
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt($fp, CURLOPT_ENCODING, '');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,10 +137,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt($fp, $curl_param, $curl_value);
</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">- $this->headers = curl_exec($fp);
- if (curl_errno($fp) === 23 || curl_errno($fp) === 61) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $responseHeaders = curl_exec($fp);
+ if (curl_errno($fp) === CURLE_WRITE_ERROR || curl_errno($fp) === CURLE_BAD_CONTENT_ENCODING) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_setopt($fp, CURLOPT_ENCODING, 'none');
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers = curl_exec($fp);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $responseHeaders = curl_exec($fp);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE);
</span><span class="cx" style="display: block; padding: 0 10px"> if (curl_errno($fp)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,19 +151,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($info = curl_getinfo($fp)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->url = $info['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_close($fp);
- $this->headers = \SimplePie\HTTP\Parser::prepareHeaders($this->headers, $info['redirect_count'] + 1);
- $parser = new \SimplePie\HTTP\Parser($this->headers);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // For PHPStan: We already checked that error did not occur.
+ assert(is_array($info) && $info['redirect_count'] >= 0);
+ if (\PHP_VERSION_ID < 80000) {
+ curl_close($fp);
+ }
+ $responseHeaders = \SimplePie\HTTP\Parser::prepareHeaders((string) $responseHeaders, $info['redirect_count'] + 1);
+ $parser = new \SimplePie\HTTP\Parser($responseHeaders, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($parser->parse()) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers = $parser->headers;
- $this->body = trim($parser->body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->set_headers($parser->headers);
+ $this->body = $parser->body;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->status_code = $parser->status_code;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && ($locationHeader = $this->get_header_line('location')) !== '' && $this->redirects < $redirects) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->redirects++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $location = \SimplePie\Misc::absolutize_url($this->headers['location'], $url);
- $previousStatusCode = $this->status_code;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $location = \SimplePie\Misc::absolutize_url($locationHeader, $url);
+ if ($location === false) {
+ $this->error = "Invalid redirect location, trying to base “{$locationHeader}” onto “{$url}”";
+ $this->success = false;
+ return;
+ }
+ $this->permanentUrlMutable = $this->permanentUrlMutable && ($this->status_code == 301 || $this->status_code == 308);
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
</del><span class="cx" style="display: block; padding: 0 10px"> return;
</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">@@ -142,10 +178,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->method = \SimplePie\SimplePie::FILE_SOURCE_REMOTE | \SimplePie\SimplePie::FILE_SOURCE_FSOCKOPEN;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url_parts = parse_url($url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($url_parts = parse_url($url)) === false) {
+ throw new \InvalidArgumentException('Malformed URL: ' . $url);
+ }
+ if (!isset($url_parts['host'])) {
+ throw new \InvalidArgumentException('Missing hostname: ' . $url);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $socket_host = $url_parts['host'];
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $socket_host = "ssl://$url_parts[host]";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $socket_host = 'ssl://' . $socket_host;
</ins><span class="cx" style="display: block; padding: 0 10px"> $url_parts['port'] = 443;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($url_parts['port'])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,36 +225,39 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $info = stream_get_meta_data($fp);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $responseHeaders = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> while (!$info['eof'] && !$info['timed_out']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers .= fread($fp, 1160);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $responseHeaders .= fread($fp, 1160);
</ins><span class="cx" style="display: block; padding: 0 10px"> $info = stream_get_meta_data($fp);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$info['timed_out']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $parser = new \SimplePie\HTTP\Parser($this->headers);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parser = new \SimplePie\HTTP\Parser($responseHeaders, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($parser->parse()) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers = $parser->headers;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->set_headers($parser->headers);
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->body = $parser->body;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->status_code = $parser->status_code;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && ($locationHeader = $this->get_header_line('location')) !== '' && $this->redirects < $redirects) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->redirects++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $location = \SimplePie\Misc::absolutize_url($this->headers['location'], $url);
- $previousStatusCode = $this->status_code;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $location = \SimplePie\Misc::absolutize_url($locationHeader, $url);
+ $this->permanentUrlMutable = $this->permanentUrlMutable && ($this->status_code == 301 || $this->status_code == 308);
+ if ($location === false) {
+ $this->error = "Invalid redirect location, trying to base “{$locationHeader}” onto “{$url}”";
+ $this->success = false;
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
</del><span class="cx" style="display: block; padding: 0 10px"> return;
</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->headers['content-encoding'])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($contentEncodingHeader = $this->get_header_line('content-encoding')) !== '') {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Hey, we act dumb elsewhere, so let's do that here too
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch (strtolower(trim($this->headers['content-encoding'], "\x09\x0A\x0D\x20"))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch (strtolower(trim($contentEncodingHeader, "\x09\x0A\x0D\x20"))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'gzip':
</span><span class="cx" style="display: block; padding: 0 10px"> case 'x-gzip':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $decoder = new \SimplePie\Gzdecode($this->body);
- if (!$decoder->parse()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($decompressed = gzdecode($this->body)) === false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->error = 'Unable to decode HTTP "gzip" stream';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->success = false;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->body = trim($decoder->data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->body = $decompressed;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->body = $decompressed;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (($decompressed = gzuncompress($this->body)) !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->body = $decompressed;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (($decompressed = gzdecode($this->body)) !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->body = $decompressed;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->error = 'Unable to decode HTTP "deflate" stream';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,12 +289,156 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->method = \SimplePie\SimplePie::FILE_SOURCE_LOCAL | \SimplePie\SimplePie::FILE_SOURCE_FILE_GET_CONTENTS;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (empty($url) || !($this->body = trim(file_get_contents($url)))) {
- $this->error = 'file_get_contents could not read the file';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (empty($url) || !is_readable($url) || false === $filebody = file_get_contents($url)) {
+ $this->body = '';
+ $this->error = sprintf('file "%s" is not readable', $url);
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->success = false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ $this->body = $filebody;
+ $this->status_code = 200;
</ins><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">+ if ($this->success) {
+ assert($this->body !== null); // For PHPStan
+ // Leading whitespace may cause XML parsing errors (XML declaration cannot be preceded by anything other than BOM) so we trim it.
+ // Note that unlike built-in `trim` function’s default settings, we do not trim `\x00` to avoid breaking characters in UTF-16 or UTF-32 encoded strings.
+ // We also only do that when the whitespace is followed by `<`, so that we do not break e.g. UTF-16LE encoded whitespace like `\n\x00` in half.
+ $this->body = preg_replace('/^[ \n\r\t\v]+</', '<', $this->body);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ public function get_permanent_uri(): string
+ {
+ return (string) $this->permanent_url;
+ }
+
+ public function get_final_requested_uri(): string
+ {
+ return (string) $this->url;
+ }
+
+ public function get_status_code(): int
+ {
+ return (int) $this->status_code;
+ }
+
+ public function get_headers(): array
+ {
+ $this->maybe_update_headers();
+ return $this->parsed_headers;
+ }
+
+ public function has_header(string $name): bool
+ {
+ $this->maybe_update_headers();
+ return $this->get_header($name) !== [];
+ }
+
+ public function get_header(string $name): array
+ {
+ $this->maybe_update_headers();
+ return $this->parsed_headers[strtolower($name)] ?? [];
+ }
+
+ public function with_header(string $name, $value)
+ {
+ $this->maybe_update_headers();
+ $new = clone $this;
+
+ $newHeader = [
+ strtolower($name) => (array) $value,
+ ];
+ $new->set_headers($newHeader + $this->get_headers());
+
+ return $new;
+ }
+
+ public function get_header_line(string $name): string
+ {
+ $this->maybe_update_headers();
+ return implode(', ', $this->get_header($name));
+ }
+
+ public function get_body_content(): string
+ {
+ return (string) $this->body;
+ }
+
+ /**
+ * Check if the $headers property was changed and update the internal state accordingly.
+ */
+ private function maybe_update_headers(): void
+ {
+ if ($this->headers !== $this->last_headers) {
+ $this->parsed_headers = array_map(
+ function (string $header_line): array {
+ if (strpos($header_line, ',') === false) {
+ return [$header_line];
+ } else {
+ return array_map('trim', explode(',', $header_line));
+ }
+ },
+ $this->headers
+ );
+ }
+ $this->last_headers = $this->headers;
+ }
+
+ /**
+ * Sets headers internally.
+ *
+ * @param array<string, non-empty-array<string>> $headers
+ */
+ private function set_headers(array $headers): void
+ {
+ $this->parsed_headers = $headers;
+ $this->headers = self::flatten_headers($headers);
+ $this->last_headers = $this->headers;
+ }
+
+ /**
+ * Converts PSR-7 compatible headers into a legacy format.
+ *
+ * @param array<string, non-empty-array<string>> $headers
+ *
+ * @return array<string, string>
+ */
+ private function flatten_headers(array $headers): array
+ {
+ return array_map(function (array $values): string {
+ return implode(',', $values);
+ }, $headers);
+ }
+
+ /**
+ * Create a File instance from another Response
+ *
+ * For BC reasons in some places there MUST be a `File` instance
+ * instead of a `Response` implementation
+ *
+ * @see Locator::__construct()
+ * @internal
+ */
+ final public static function fromResponse(Response $response): self
+ {
+ $headers = [];
+
+ foreach ($response->get_headers() as $name => $header) {
+ $headers[$name] = implode(', ', $header);
+ }
+
+ /** @var File */
+ $file = (new \ReflectionClass(File::class))->newInstanceWithoutConstructor();
+
+ $file->url = $response->get_final_requested_uri();
+ $file->useragent = null;
+ $file->headers = $headers;
+ $file->body = $response->get_body_content();
+ $file->status_code = $response->get_status_code();
+ $file->permanent_url = $response->get_permanent_uri();
+
+ return $file;
+ }
</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"> class_alias('SimplePie\File', 'SimplePie_File');
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcGzdecodephp"></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/src/Gzdecode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Gzdecode.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Gzdecode.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,55 +1,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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"> * Decode 'gzip' encoded HTTP data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage HTTP
</del><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.gzip.org/format.txt
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @link https://www.php.net/manual/en/function.gzdecode.php
+ * @deprecated since SimplePie 1.9.0, use `gzdecode` function instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Gzdecode
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $value
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __set($name, $value)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __set(string $name, $value)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new Exception("Cannot write property $name");
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->compressed_data = $data;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->compressed_size = strlen($data);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,10 +187,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // MTIME
</span><span class="cx" style="display: block; padding: 0 10px"> $mtime = substr($this->compressed_data, $this->position, 4);
</span><span class="cx" style="display: block; padding: 0 10px"> // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (current(unpack('S', "\x00\x01")) === 1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (current((array) unpack('S', "\x00\x01")) === 1) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $mtime = strrev($mtime);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->MTIME = current(unpack('l', $mtime));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->MTIME = current((array) unpack('l', $mtime));
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += 4;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the XFL (eXtra FLags)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,7 +211,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"> // Get the length of the extra field
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $len = current((array) unpack('v', substr($this->compressed_data, $this->position, 2)));
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += 2;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the length of the string is still valid
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +263,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->min_compressed_size += $len + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->compressed_size >= $this->min_compressed_size) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Read the CRC
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $crc = current((array) unpack('v', substr($this->compressed_data, $this->position, 2)));
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the CRC matches
</span><span class="cx" style="display: block; padding: 0 10px"> if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,14 +277,15 @@
</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"> // Decompress the actual data
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</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->data = $data;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position = $this->compressed_size - 8;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check CRC of data
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $crc = current((array) unpack('V', substr($this->compressed_data, $this->position, 4)));
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += 4;
</span><span class="cx" style="display: block; padding: 0 10px"> /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,7 +293,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"> // Check ISIZE of data
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $isize = current((array) unpack('V', substr($this->compressed_data, $this->position, 4)));
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += 4;
</span><span class="cx" style="display: block; padding: 0 10px"> if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize)) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcHTTPClientphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/Client.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/Client.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/Client.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,28 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+/**
+ * HTTP Client interface
+ *
+ * @internal
+ */
+interface Client
+{
+ public const METHOD_GET = 'GET';
+
+ /**
+ * send a request and return the response
+ *
+ * @param Client::METHOD_* $method
+ * @param array<string, string> $headers
+ *
+ * @throws ClientException if anything goes wrong requesting the data
+ */
+ public function request(string $method, string $url, array $headers = []): Response;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/Client.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPClientExceptionphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/ClientException.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/ClientException.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/ClientException.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,19 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+use SimplePie\Exception as SimplePieException;
+
+/**
+ * Client exception class
+ *
+ * @internal
+ */
+final class ClientException extends SimplePieException
+{
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/ClientException.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPFileClientphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/FileClient.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/FileClient.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/FileClient.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,77 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+use InvalidArgumentException;
+use SimplePie\File;
+use SimplePie\Misc;
+use SimplePie\Registry;
+use Throwable;
+
+/**
+ * HTTP Client based on \SimplePie\File
+ *
+ * @internal
+ */
+final class FileClient implements Client
+{
+ /** @var Registry */
+ private $registry;
+
+ /** @var array{timeout?: int, redirects?: int, useragent?: string, force_fsockopen?: bool, curl_options?: array<mixed>} */
+ private $options;
+
+ /**
+ * @param array{timeout?: int, redirects?: int, useragent?: string, force_fsockopen?: bool, curl_options?: array<mixed>} $options
+ */
+ public function __construct(Registry $registry, array $options = [])
+ {
+ $this->registry = $registry;
+ $this->options = $options;
+ }
+
+ /**
+ * send a request and return the response
+ *
+ * @param Client::METHOD_* $method
+ * @param array<string, string> $headers
+ *
+ * @throws ClientException if anything goes wrong requesting the data
+ */
+ public function request(string $method, string $url, array $headers = []): Response
+ {
+ // @phpstan-ignore-next-line Enforce PHPDoc type.
+ if ($method !== self::METHOD_GET) {
+ throw new InvalidArgumentException(sprintf(
+ '%s(): Argument #1 ($method) only supports method "%s".',
+ __METHOD__,
+ self::METHOD_GET
+ ), 1);
+ }
+
+ try {
+ $file = $this->registry->create(File::class, [
+ $url,
+ $this->options['timeout'] ?? 10,
+ $this->options['redirects'] ?? 5,
+ $headers,
+ $this->options['useragent'] ?? Misc::get_default_useragent(),
+ $this->options['force_fsockopen'] ?? false,
+ $this->options['curl_options'] ?? []
+ ]);
+ } catch (Throwable $th) {
+ throw new ClientException($th->getMessage(), $th->getCode(), $th);
+ }
+
+ if ($file->error !== null && $file->get_status_code() === 0) {
+ throw new ClientException($file->error);
+ }
+
+ return $file;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/FileClient.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPParserphp"></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/src/HTTP/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\HTTP;
</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"> * HTTP Response Parser
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage HTTP
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @template Psr7Compatible of bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Parser
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,9 +35,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $reason = '';
</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 Psr7Compatible whether headers are compatible with PSR-7 format.
+ */
+ private $psr7Compatible;
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Key/value pairs of the headers
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var (Psr7Compatible is true ? array<string, non-empty-array<string>> : array<string, string>)
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $headers = [];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $position = 0;
</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">- * Name of the hedaer currently being parsed
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Name of the header currently being parsed
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $name = '';
</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">- * Value of the hedaer currently being parsed
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Value of the header currently being parsed
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,11 +127,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Create an instance of the class with the input data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Input data
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param Psr7Compatible $psr7Compatible Whether the data types are in format compatible with PSR-7.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $data, bool $psr7Compatible = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = $data;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data_length = strlen($this->data);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->psr7Compatible = $psr7Compatible;
</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">@@ -184,7 +152,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- $this->http_version = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Reset the parser state.
+ $this->http_version = 0.0;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->status_code = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->reason = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->headers = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,15 +187,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"> * Parse the HTTP version
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function http_version()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/') {
</span><span class="cx" style="display: block; padding: 0 10px"> $len = strspn($this->data, '0123456789.', 5);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->http_version = substr($this->data, 5, $len);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $http_version = substr($this->data, 5, $len);
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += 5 + $len;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (substr_count($this->http_version, '.') <= 1) {
- $this->http_version = (float) $this->http_version;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (substr_count($http_version, '.') <= 1) {
+ $this->http_version = (float) $http_version;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->position += strspn($this->data, "\x09\x20", $this->position);
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_STATUS;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,6 +209,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"> * Parse the status code
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function status()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,6 +224,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"> * Parse the reason phrase
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function reason()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,8 +234,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_NEW_LINE;
</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">+ private function add_header(string $name, string $value): void
+ {
+ if ($this->psr7Compatible) {
+ // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough.
+ /** @var array<string, non-empty-array<string>> */
+ $headers = &$this->headers;
+ $headers[$name][] = $value;
+ } else {
+ // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough.
+ /** @var array<string, string>) */
+ $headers = &$this->headers;
+ $headers[$name] .= ', ' . $value;
+ }
+ }
+
+ private function replace_header(string $name, string $value): void
+ {
+ if ($this->psr7Compatible) {
+ // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough.
+ /** @var array<string, non-empty-array<string>> */
+ $headers = &$this->headers;
+ $headers[$name] = [$value];
+ } else {
+ // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough.
+ /** @var array<string, string>) */
+ $headers = &$this->headers;
+ $headers[$name] = $value;
+ }
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Deal with a new line, shifting data around as needed
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function new_line()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,9 +275,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->name = strtolower($this->name);
</span><span class="cx" style="display: block; padding: 0 10px"> // We should only use the last Content-Type header. c.f. issue #1
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->headers[$this->name]) && $this->name !== 'content-type') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers[$this->name] .= ', ' . $this->value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_header($this->name, $this->value);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->headers[$this->name] = $this->value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->replace_header($this->name, $this->value);
</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"> $this->name = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,6 +295,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"> * Parse a header name
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function name()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,6 +316,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"> * Parse LWS, replacing consecutive LWS characters with a single space
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function linear_whitespace()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,6 +333,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"> * See what state to move to while within non-quoted header values
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function value()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,6 +368,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"> * Parse a header value while outside quotes
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function value_char()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,6 +380,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"> * See what state to move to while within quoted header values
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function quote()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,6 +412,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"> * Parse a header value while within quotes
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function quote_char()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,6 +424,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"> * Parse an escaped character within quotes
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function quote_escaped()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,6 +435,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"> * Parse the body
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function body()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,6 +450,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"> * Parsed a "Transfer-Encoding: chunked" body
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function chunked()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -459,6 +471,9 @@
</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"> $length = hexdec(trim($matches[1]));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // For PHPStan: this will only be float when larger than PHP_INT_MAX.
+ // But even on 32-bit systems, it would mean 2GiB chunk, which sounds unlikely.
+ \assert(\is_int($length), "Length needs to be shorter than PHP_INT_MAX");
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($length === 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Ignore trailer headers
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_EMIT;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,11 +500,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Prepare headers (take care of proxies headers)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $headers Raw headers
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param integer $count Redirection count. Default to 1.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param non-negative-int $count Redirection count. Default to 1.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function prepareHeaders($headers, $count = 1)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function prepareHeaders(string $headers, int $count = 1)
</ins><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></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcHTTPPsr18Clientphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/Psr18Client.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/Psr18Client.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/Psr18Client.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,162 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+use InvalidArgumentException;
+use Psr\Http\Client\ClientExceptionInterface;
+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\UriFactoryInterface;
+use Throwable;
+
+/**
+ * HTTP Client based on PSR-18 and PSR-17 implementations
+ *
+ * @internal
+ */
+final class Psr18Client implements Client
+{
+ /**
+ * @var ClientInterface
+ */
+ private $httpClient;
+
+ /**
+ * @var RequestFactoryInterface
+ */
+ private $requestFactory;
+
+ /**
+ * @var UriFactoryInterface
+ */
+ private $uriFactory;
+
+ /**
+ * @var int
+ */
+ private $allowedRedirects = 5;
+
+ public function __construct(ClientInterface $httpClient, RequestFactoryInterface $requestFactory, UriFactoryInterface $uriFactory)
+ {
+ $this->httpClient = $httpClient;
+ $this->requestFactory = $requestFactory;
+ $this->uriFactory = $uriFactory;
+ }
+
+ public function getHttpClient(): ClientInterface
+ {
+ return $this->httpClient;
+ }
+
+ public function getRequestFactory(): RequestFactoryInterface
+ {
+ return $this->requestFactory;
+ }
+
+ public function getUriFactory(): UriFactoryInterface
+ {
+ return $this->uriFactory;
+ }
+
+ /**
+ * send a request and return the response
+ *
+ * @param Client::METHOD_* $method
+ * @param string $url
+ * @param array<string,string|string[]> $headers
+ *
+ * @throws ClientException if anything goes wrong requesting the data
+ */
+ public function request(string $method, string $url, array $headers = []): Response
+ {
+ if ($method !== self::METHOD_GET) {
+ throw new InvalidArgumentException(sprintf(
+ '%s(): Argument #1 ($method) only supports method "%s".',
+ __METHOD__,
+ self::METHOD_GET
+ ), 1);
+ }
+
+ if (preg_match('/^http(s)?:\/\//i', $url)) {
+ return $this->requestUrl($method, $url, $headers);
+ }
+
+ return $this->requestLocalFile($url);
+ }
+
+ /**
+ * @param array<string,string|string[]> $headers
+ */
+ private function requestUrl(string $method, string $url, array $headers): Response
+ {
+ $permanentUrl = $url;
+ $requestedUrl = $url;
+ $remainingRedirects = $this->allowedRedirects;
+
+ $request = $this->requestFactory->createRequest(
+ $method,
+ $this->uriFactory->createUri($requestedUrl)
+ );
+
+ foreach ($headers as $name => $value) {
+ $request = $request->withHeader($name, $value);
+ }
+
+ do {
+ $followRedirect = false;
+
+ try {
+ $response = $this->httpClient->sendRequest($request);
+ } catch (ClientExceptionInterface $th) {
+ throw new ClientException($th->getMessage(), $th->getCode(), $th);
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ // If we have a redirect
+ if (in_array($statusCode, [300, 301, 302, 303, 307]) && $response->hasHeader('Location')) {
+ // Prevent infinity redirect loops
+ if ($remainingRedirects <= 0) {
+ break;
+ }
+
+ $remainingRedirects--;
+ $followRedirect = true;
+
+ $requestedUrl = $response->getHeaderLine('Location');
+
+ if ($statusCode === 301) {
+ $permanentUrl = $requestedUrl;
+ }
+
+ $request = $request->withUri($this->uriFactory->createUri($requestedUrl));
+ }
+ } while ($followRedirect);
+
+ return new Psr7Response($response, $permanentUrl, $requestedUrl);
+ }
+
+ private function requestLocalFile(string $path): Response
+ {
+ if (!is_readable($path)) {
+ throw new ClientException(sprintf('file "%s" is not readable', $path));
+ }
+
+ try {
+ $raw = file_get_contents($path);
+ } catch (Throwable $th) {
+ throw new ClientException($th->getMessage(), $th->getCode(), $th);
+ }
+
+ if ($raw === false) {
+ throw new ClientException('file_get_contents() could not read the file', 1);
+ }
+
+ return new RawTextResponse($raw, $path);
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/Psr18Client.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPPsr7Responsephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/Psr7Response.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/Psr7Response.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/Psr7Response.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,91 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+use Psr\Http\Message\ResponseInterface;
+
+/**
+ * HTTP Response based on a PSR-7 response
+ *
+ * This interface must be interoperable with Psr\Http\Message\ResponseInterface
+ * @see https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface
+ *
+ * @internal
+ */
+final class Psr7Response implements Response
+{
+ /**
+ * @var ResponseInterface
+ */
+ private $response;
+
+ /**
+ * @var string
+ */
+ private $permanent_url;
+
+ /**
+ * @var string
+ */
+ private $requested_url;
+
+ public function __construct(ResponseInterface $response, string $permanent_url, string $requested_url)
+ {
+ $this->response = $response;
+ $this->permanent_url = $permanent_url;
+ $this->requested_url = $requested_url;
+ }
+
+ public function get_permanent_uri(): string
+ {
+ return $this->permanent_url;
+ }
+
+ public function get_final_requested_uri(): string
+ {
+ return $this->requested_url;
+ }
+
+ public function get_status_code(): int
+ {
+ return $this->response->getStatusCode();
+ }
+
+ public function get_headers(): array
+ {
+ // The filtering is probably redundant but let’s make PHPStan happy.
+ return array_filter($this->response->getHeaders(), function (array $header): bool {
+ return count($header) >= 1;
+ });
+ }
+
+ public function has_header(string $name): bool
+ {
+ return $this->response->hasHeader($name);
+ }
+
+ public function with_header(string $name, $value)
+ {
+ return new self($this->response->withHeader($name, $value), $this->permanent_url, $this->requested_url);
+ }
+
+ public function get_header(string $name): array
+ {
+ return $this->response->getHeader($name);
+ }
+
+ public function get_header_line(string $name): string
+ {
+ return $this->response->getHeaderLine($name);
+ }
+
+ public function get_body_content(): string
+ {
+ return $this->response->getBody()->__toString();
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/Psr7Response.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPRawTextResponsephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/RawTextResponse.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/RawTextResponse.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/RawTextResponse.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,98 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+/**
+ * HTTP Response for rax text
+ *
+ * This interface must be interoperable with Psr\Http\Message\ResponseInterface
+ * @see https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface
+ *
+ * @internal
+ */
+final class RawTextResponse implements Response
+{
+ /**
+ * @var string
+ */
+ private $raw_text;
+
+ /**
+ * @var string
+ */
+ private $permanent_url;
+
+ /**
+ * @var array<non-empty-array<string>>
+ */
+ private $headers = [];
+
+ /**
+ * @var string
+ */
+ private $requested_url;
+
+ public function __construct(string $raw_text, string $filepath)
+ {
+ $this->raw_text = $raw_text;
+ $this->permanent_url = $filepath;
+ $this->requested_url = $filepath;
+ }
+
+ public function get_permanent_uri(): string
+ {
+ return $this->permanent_url;
+ }
+
+ public function get_final_requested_uri(): string
+ {
+ return $this->requested_url;
+ }
+
+ public function get_status_code(): int
+ {
+ return 200;
+ }
+
+ public function get_headers(): array
+ {
+ return $this->headers;
+ }
+
+ public function has_header(string $name): bool
+ {
+ return isset($this->headers[strtolower($name)]);
+ }
+
+ public function get_header(string $name): array
+ {
+ return isset($this->headers[strtolower($name)]) ? $this->headers[$name] : [];
+ }
+
+ public function with_header(string $name, $value)
+ {
+ $new = clone $this;
+
+ $newHeader = [
+ strtolower($name) => (array) $value,
+ ];
+ $new->headers = $newHeader + $this->headers;
+
+ return $new;
+ }
+
+ public function get_header_line(string $name): string
+ {
+ return isset($this->headers[strtolower($name)]) ? implode(", ", $this->headers[$name]) : '';
+ }
+
+ public function get_body_content(): string
+ {
+ return $this->raw_text;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/RawTextResponse.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcHTTPResponsephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/SimplePie/src/HTTP/Response.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/HTTP/Response.php (rev 0)
+++ trunk/src/wp-includes/SimplePie/src/HTTP/Response.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,171 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-FileCopyrightText: 2014 PHP Framework Interoperability Group
+// SPDX-License-Identifier: MIT
+
+declare(strict_types=1);
+
+namespace SimplePie\HTTP;
+
+/**
+ * HTTP Response interface
+ *
+ * This interface must be interoperable with Psr\Http\Message\ResponseInterface
+ * @see https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface
+ *
+ * @internal
+ */
+interface Response
+{
+ /**
+ * Return the string representation of the permanent URI of the requested resource
+ * (the first location after a prefix of (only) permanent redirects).
+ *
+ * Depending on which components of the URI are present, the resulting
+ * string is either a full URI or relative reference according to RFC 3986,
+ * Section 4.1. The method concatenates the various components of the URI,
+ * using the appropriate delimiters:
+ *
+ * - If a scheme is present, it MUST be suffixed by ":".
+ * - If an authority is present, it MUST be prefixed by "//".
+ * - The path can be concatenated without delimiters. But there are two
+ * cases where the path has to be adjusted to make the URI reference
+ * valid as PHP does not allow to throw an exception in __toString():
+ * - If the path is rootless and an authority is present, the path MUST
+ * be prefixed by "/".
+ * - If the path is starting with more than one "/" and no authority is
+ * present, the starting slashes MUST be reduced to one.
+ * - If a query is present, it MUST be prefixed by "?".
+ * - If a fragment is present, it MUST be prefixed by "#".
+ *
+ * @see http://tools.ietf.org/html/rfc3986#section-4.1
+ */
+ public function get_permanent_uri(): string;
+
+ /**
+ * Return the string representation of the final requested URL after following all redirects.
+ *
+ * Depending on which components of the URI are present, the resulting
+ * string is either a full URI or relative reference according to RFC 3986,
+ * Section 4.1. The method concatenates the various components of the URI,
+ * using the appropriate delimiters:
+ *
+ * - If a scheme is present, it MUST be suffixed by ":".
+ * - If an authority is present, it MUST be prefixed by "//".
+ * - The path can be concatenated without delimiters. But there are two
+ * cases where the path has to be adjusted to make the URI reference
+ * valid as PHP does not allow to throw an exception in __toString():
+ * - If the path is rootless and an authority is present, the path MUST
+ * be prefixed by "/".
+ * - If the path is starting with more than one "/" and no authority is
+ * present, the starting slashes MUST be reduced to one.
+ * - If a query is present, it MUST be prefixed by "?".
+ * - If a fragment is present, it MUST be prefixed by "#".
+ *
+ * @see http://tools.ietf.org/html/rfc3986#section-4.1
+ */
+ public function get_final_requested_uri(): string;
+
+ /**
+ * Gets the response status code.
+ *
+ * The status code is a 3-digit integer result code of the server's attempt
+ * to understand and satisfy the request.
+ *
+ * @return int Status code.
+ */
+ public function get_status_code(): int;
+
+ /**
+ * Retrieves all message header values.
+ *
+ * The keys represent the header name as it will be sent over the wire, and
+ * each value is an array of strings associated with the header.
+ *
+ * // Represent the headers as a string
+ * foreach ($message->get_headers() as $name => $values) {
+ * echo $name . ': ' . implode(', ', $values);
+ * }
+ *
+ * // Emit headers iteratively:
+ * foreach ($message->get_headers() as $name => $values) {
+ * foreach ($values as $value) {
+ * header(sprintf('%s: %s', $name, $value), false);
+ * }
+ * }
+ *
+ * @return array<non-empty-array<string>> Returns an associative array of the message's headers.
+ * Each key MUST be a header name, and each value MUST be an array of
+ * strings for that header.
+ */
+ public function get_headers(): array;
+
+ /**
+ * Checks if a header exists by the given case-insensitive name.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return bool Returns true if any header names match the given header
+ * name using a case-insensitive string comparison. Returns false if
+ * no matching header name is found in the message.
+ */
+ public function has_header(string $name): bool;
+
+ /**
+ * Retrieves a message header value by the given case-insensitive name.
+ *
+ * This method returns an array of all the header values of the given
+ * case-insensitive header name.
+ *
+ * If the header does not appear in the message, this method MUST return an
+ * empty array.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return string[] An array of string values as provided for the given
+ * header. If the header does not appear in the message, this method MUST
+ * return an empty array.
+ */
+ public function get_header(string $name): array;
+
+ /**
+ * Return an instance with the provided value replacing the specified header.
+ *
+ * This method MUST be implemented in such a way as to retain the
+ * immutability of the message, and MUST return an instance that has the
+ * new and/or updated header and value.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @param string|non-empty-array<string> $value Header value(s).
+ * @return static
+ * @throws \InvalidArgumentException for invalid header names or values.
+ */
+ public function with_header(string $name, $value);
+
+ /**
+ * Retrieves a comma-separated string of the values for a single header.
+ *
+ * This method returns all of the header values of the given
+ * case-insensitive header name as a string concatenated together using
+ * a comma.
+ *
+ * NOTE: Not all header values may be appropriately represented using
+ * comma concatenation. For such headers, use getHeader() instead
+ * and supply your own delimiter when concatenating.
+ *
+ * If the header does not appear in the message, this method MUST return
+ * an empty string.
+ *
+ * @param string $name Case-insensitive header field name.
+ * @return string A string of values as provided for the given header
+ * concatenated together using a comma. If the header does not appear in
+ * the message, this method MUST return an empty string.
+ */
+ public function get_header_line(string $name): string;
+
+ /**
+ * get the body as string
+ *
+ * @return string
+ */
+ public function get_body_content(): string;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/SimplePie/src/HTTP/Response.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesSimplePiesrcIRIphp"></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/src/IRI.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/IRI.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/IRI.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,59 +1,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-FileCopyrightText: 2008 Steve Minutillo
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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"> * IRI parser/serialiser/normaliser
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage HTTP
- * @author Sam Sneddon
- * @author Steve Minutillo
- * @author Ryan McCue
- * @copyright 2007-2012 Sam Sneddon, Steve Minutillo, Ryan McCue
- * @license http://www.opensource.org/licenses/bsd-license.php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @property ?string $scheme
+ * @property ?string $userinfo
+ * @property ?string $host
+ * @property ?int $port
+ * @property-write int|string|null $port
+ * @property ?string $authority
+ * @property string $path
+ * @property ?string $query
+ * @property ?string $fragment
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class IRI
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * 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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $scheme = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * User Information
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $iuserinfo = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ihost
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $ihost = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Port
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?int
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $port = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * iquery
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $iquery = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * ifragment
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $ifragment = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,6 +77,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Each key is the scheme, each value is an array with each key as the IRI
</span><span class="cx" style="display: block; padding: 0 10px"> * part and value as the default value for that part.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @var array<string, array<string, mixed>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $normalization = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'acap' => [
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __toString()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->get_iri();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (string) $this->get_iri();
</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">@@ -147,11 +115,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Property name
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $value Property value
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __set($name, $value)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __set(string $name, $value)
</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 (method_exists($this, 'set_' . $name)) {
- call_user_func([$this, 'set_' . $name], $value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $callable = [$this, 'set_' . $name];
+ if (is_callable($callable)) {
+ call_user_func($callable, $value);
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif (
</span><span class="cx" style="display: block; padding: 0 10px"> $name === 'iauthority'
</span><span class="cx" style="display: block; padding: 0 10px"> || $name === 'iuserinfo'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Property name
</span><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __get($name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __get(string $name)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // isset() returns false for null, we don't want to do that
</span><span class="cx" style="display: block; padding: 0 10px"> // Also why we use array_key_exists below instead of isset()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $return = $this->$name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // host -> ihost
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ elseif (array_key_exists($prop = 'i' . $name, $props)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $name = $prop;
</span><span class="cx" style="display: block; padding: 0 10px"> $return = $this->$prop;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,7 +183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Property name
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __isset($name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __isset(string $name)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return method_exists($this, 'get_' . $name) || isset($this->$name);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,11 +192,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Overload __unset() to provide access via properties
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Property name
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __unset($name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __unset(string $name)
</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 (method_exists($this, 'set_' . $name)) {
- call_user_func([$this, 'set_' . $name], '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $callable = [$this, 'set_' . $name];
+ if (is_callable($callable)) {
+ call_user_func($callable, '');
</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">@@ -233,9 +205,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create a new IRI object, from a specified string
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $iri
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $iri
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($iri = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(?string $iri = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_iri($iri);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,6 +214,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"> * Clean up
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __destruct()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -321,27 +294,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse an IRI into scheme/authority/path/query/fragment segments
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $iri
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array{
+ * scheme: string|null,
+ * authority: string|null,
+ * path: string,
+ * query: string|null,
+ * fragment: string|null,
+ * }|false
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function parse_iri($iri)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function parse_iri(string $iri)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $iri = trim($iri, "\x20\x09\x0A\x0C\x0D");
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (preg_match('/^((?P<scheme>[^:\/?#]+):)?(\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match)) {
- if ($match[1] === '') {
- $match['scheme'] = null;
- }
- if (!isset($match[3]) || $match[3] === '') {
- $match['authority'] = null;
- }
- if (!isset($match[5])) {
- $match['path'] = '';
- }
- if (!isset($match[6]) || $match[6] === '') {
- $match['query'] = null;
- }
- if (!isset($match[8]) || $match[8] === '') {
- $match['fragment'] = null;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (preg_match('/^(?:(?P<scheme>[^:\/?#]+):)?(:?\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(?:\?(?P<query>[^#]*))?(?:#(?P<fragment>.*))?$/', $iri, $match, \PREG_UNMATCHED_AS_NULL)) {
+ // TODO: Remove once we require PHP ≥ 7.4.
+ $match['query'] = $match['query'] ?? null;
+ $match['fragment'] = $match['fragment'] ?? null;
</ins><span class="cx" style="display: block; padding: 0 10px"> return $match;
</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">@@ -355,7 +322,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $input
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function remove_dot_segments($input)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function remove_dot_segments(string $input)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,13 +371,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $iprivate Allow iprivate
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function replace_invalid_with_pct_encoding(string $string, string $extra_chars, bool $iprivate = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Normalize as many pct-encoded sections as possible
</span><span class="cx" style="display: block; padding: 0 10px"> $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', [$this, 'remove_iunreserved_percent_encoded'], $string);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ \assert(\is_string($string), "For PHPStan: Should not occur, the regex is valid");
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Replace invalid percent characters
</span><span class="cx" style="display: block; padding: 0 10px"> $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ \assert(\is_string($string), "For PHPStan: Should not occur, the regex is valid");
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add unreserved and % to $extra_chars (the latter is safe because all
</span><span class="cx" style="display: block; padding: 0 10px"> // pct-encoded sections are now valid).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,10 +494,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Removes sequences of percent encoded bytes that represent UTF-8
</span><span class="cx" style="display: block; padding: 0 10px"> * encoded characters in iunreserved
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $match PCRE match
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array{string} $match PCRE match, a capture group #0 consisting of a sequence of valid percent-encoded bytes
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Replacement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function remove_iunreserved_percent_encoded($match)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function remove_iunreserved_percent_encoded(array $match)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // As we just have valid percent encoded sequences we can just explode
</span><span class="cx" style="display: block; padding: 0 10px"> // and ignore the first member of the returned array (an empty string).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -631,7 +600,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> for ($j = $start; $j <= $i; $j++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $string .= chr(hexdec($bytes[$j]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan, this will always be a number between 0 and 0xFF so hexdec will return int.
+ $string .= chr((int) hexdec($bytes[$j]));
</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">@@ -648,6 +618,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $string;
</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 void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> protected function scheme_normalization()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -708,15 +681,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the entire IRI. Returns true on success, false on failure (if there
</span><span class="cx" style="display: block; padding: 0 10px"> * are any invalid characters).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $iri
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $iri
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_iri($iri, $clear_cache = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_iri(?string $iri, bool $clear_cache = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $cache;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($clear_cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -768,10 +741,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the scheme. Returns true on success, false on failure (if there are
</span><span class="cx" style="display: block; padding: 0 10px"> * any invalid characters).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $scheme
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $scheme
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_scheme($scheme)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_scheme(?string $scheme)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($scheme === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->scheme = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -788,15 +761,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the authority. Returns true on success, false on failure (if there are
</span><span class="cx" style="display: block; padding: 0 10px"> * any invalid characters).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $authority
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $authority
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_authority($authority, $clear_cache = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_authority(?string $authority, bool $clear_cache = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $cache;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($clear_cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -820,13 +793,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $remaining = $authority;
</span><span class="cx" style="display: block; padding: 0 10px"> if (($iuserinfo_end = strrpos($remaining, '@')) !== false) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $iuserinfo = substr($remaining, 0, $iuserinfo_end);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan on PHP < 8.0. It does not detect that
+ // the range is not flipped so substr cannot return false.
+ $iuserinfo = (string) substr($remaining, 0, $iuserinfo_end);
</ins><span class="cx" style="display: block; padding: 0 10px"> $remaining = substr($remaining, $iuserinfo_end + 1);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $iuserinfo = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (($port_start = strpos($remaining, ':', intval(strpos($remaining, ']')))) !== false) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (($port = substr($remaining, $port_start + 1)) === false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $port = substr($remaining, $port_start + 1);
+ if ($port === false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $port = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $remaining = substr($remaining, 0, $port_start);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -851,10 +827,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the iuserinfo.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $iuserinfo
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $iuserinfo
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_userinfo($iuserinfo)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_userinfo(?string $iuserinfo)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($iuserinfo === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->iuserinfo = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -870,10 +846,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the ihost. Returns true on success, false on failure (if there are
</span><span class="cx" style="display: block; padding: 0 10px"> * any invalid characters).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $ihost
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $ihost
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_host($ihost)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_host(?string $ihost)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($ihost === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ihost = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -914,7 +890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the port. Returns true on success, false on failure (if there are
</span><span class="cx" style="display: block; padding: 0 10px"> * any invalid characters).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $port
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int|null $port
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_port($port)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -922,7 +898,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($port === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->port = null;
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (strspn($port, '0123456789') === strlen($port)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (strspn((string) $port, '0123456789') === strlen((string) $port)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->port = (int) $port;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->scheme_normalization();
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -935,15 +911,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the ipath.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $ipath
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $ipath
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_path($ipath, $clear_cache = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_path(?string $ipath, bool $clear_cache = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $cache;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($clear_cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -968,10 +944,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the iquery.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $iquery
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $iquery
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_query($iquery)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_query(?string $iquery)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($iquery === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->iquery = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -985,10 +961,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the ifragment.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $ifragment
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $ifragment
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_fragment($ifragment)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_fragment(?string $ifragment)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($ifragment === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ifragment = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1002,9 +978,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Convert an IRI to a URI (or parts thereof)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function to_uri($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function to_uri(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $non_ascii;
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$non_ascii) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1025,7 +1002,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the complete IRI
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_iri()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1062,13 +1039,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_uri()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->to_uri($this->get_iri());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->to_uri((string) $this->get_iri());
</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="cx" style="display: block; padding: 0 10px"> * Get the complete iauthority
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function get_iauthority()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1092,7 +1069,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the complete authority
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function get_authority()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcItemphp"></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/src/Item.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Item.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Item.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\SimplePie::get_item()} and {@see \SimplePie\SimplePie::get_items()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_item_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package \SimplePie\SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Item implements RegistryAware
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Raw data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $data = [];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,6 +41,11 @@
</span><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"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Sanitize|null
+ */
+ private $sanitize = null;
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Create a new item object
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This is usually used by {@see \SimplePie\SimplePie::get_items} and
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,9 +52,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * {@see \SimplePie\SimplePie::get_item}. Avoid creating this manually.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param \SimplePie\SimplePie $feed Parent feed
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $data Raw data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, mixed> $data Raw data
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($feed, $data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(\SimplePie\SimplePie $feed, array $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->feed = $feed;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = $data;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,8 +67,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.3
</span><span class="cx" style="display: block; padding: 0 10px"> * @param \SimplePie\Registry $registry
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_registry(\SimplePie\Registry $registry)/* : void */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_registry(\SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry = $registry;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,9 +106,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $namespace The URL of the XML namespace of the elements you're trying to access
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tag Tag name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<array<string, mixed>>|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_item_tags($namespace, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_item_tags(string $namespace, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->data['child'][$namespace][$tag])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->data['child'][$namespace][$tag];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,13 +118,31 @@
</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 base URL of the item itself.
+ * Returns `<xml:base>` or feed base URL.
+ * Similar to `Item::get_base()` but can safely be used during initialisation methods
+ * such as `Item::get_links()` (`Item::get_base()` and `Item::get_links()` call each-other)
+ * and is not affected by enclosures.
+ *
+ * @param array<string, mixed> $element
+ * @see get_base
+ */
+ private function get_own_base(array $element = []): string
+ {
+ if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) {
+ return $element['xml_base'];
+ }
+ return $this->feed->get_base();
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Get the base URL value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Uses `<xml:base>`, or item link, or feed base URL.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Uses `<xml:base>`, or item link, or enclosure link, or feed base URL.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $element
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, mixed> $element
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_base($element = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_base(array $element = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $element['xml_base'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,12 +160,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> * @see \SimplePie\SimplePie::sanitize()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Data to sanitize
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $type One of the \SimplePie\SimplePie::CONSTRUCT_* constants
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $base Base URL to resolve URLs against
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Sanitized data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function sanitize($data, $type, $base = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function sanitize(string $data, int $type, string $base = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations.
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->feed->sanitize($data, $type, $base);
</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">@@ -209,11 +194,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * MD5 hash based on the permalink, title and content.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param boolean $hash Should we force using a hash instead of the supplied ID?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $hash Should we force using a hash instead of the supplied ID?
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|false $fn User-supplied function to generate an hash
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_id($hash = false, $fn = 'md5')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_id(bool $hash = false, $fn = 'md5')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$hash) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'id')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,10 +271,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * `<itunes:subtitle>`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.8
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param boolean $description_only Should we avoid falling back to the content?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $description_only Should we avoid falling back to the content?
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_description($description_only = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_description(bool $description_only = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'summary')) &&
</span><span class="cx" style="display: block; padding: 0 10px"> ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,10 +321,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param boolean $content_only Should we avoid falling back to the description?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $content_only Should we avoid falling back to the description?
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_content($content_only = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_content(bool $content_only = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'content')) &&
</span><span class="cx" style="display: block; padding: 0 10px"> ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_10_content_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +348,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<media:thumbnail>`
</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">- * @return array|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array{url: string, height?: string, width?: string, time?: string}|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_thumbnail()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,7 +375,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Category|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_category($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_category(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = $this->get_categories();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($categories[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -462,7 +447,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Author|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_author($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_author(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $authors = $this->get_authors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($authors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,7 +464,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Author|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_contributor($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_contributor(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $contributors = $this->get_contributors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,7 +493,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,7 +511,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,7 +548,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -578,7 +566,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -617,7 +606,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<atom:rights>` or `<dc:rights>`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_copyright()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -644,9 +633,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2 (previously called `get_item_date` since 0.8)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ($date_format is 'U' ? ?int : ?string)
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_date($date_format = 'j F Y, g:i a')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_date(string $date_format = 'j F Y, g:i a')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['date'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'published')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -675,7 +664,6 @@
</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"> if ($this->data['date']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $date_format = (string) $date_format;
</del><span class="cx" style="display: block; padding: 0 10px"> switch ($date_format) {
</span><span class="cx" style="display: block; padding: 0 10px"> case '':
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->sanitize($this->data['date']['raw'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -700,9 +688,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * {@see get_gmdate}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ($date_format is 'U' ? ?int : ?string)
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_updated_date($date_format = 'j F Y, g:i a')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_updated_date(string $date_format = 'j F Y, g:i a')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['updated'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'updated')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -717,7 +705,6 @@
</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"> if ($this->data['updated']) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $date_format = (string) $date_format;
</del><span class="cx" style="display: block; padding: 0 10px"> switch ($date_format) {
</span><span class="cx" style="display: block; padding: 0 10px"> case '':
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->sanitize($this->data['updated']['raw'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -744,12 +731,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|null|false see `strftime` for when this can return `false`
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_local_date($date_format = '%c')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_local_date(string $date_format = '%c')
</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 (!$date_format) {
- return $this->sanitize($this->get_date(''), \SimplePie\SimplePie::CONSTRUCT_TEXT);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($date_format === '') {
+ if (($raw_date = $this->get_date('')) === null) {
+ return null;
+ }
+
+ return $this->sanitize($raw_date, \SimplePie\SimplePie::CONSTRUCT_TEXT);
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif (($date = $this->get_date('U')) !== null && $date !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return strftime($date_format, $date);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -762,9 +753,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_date
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_gmdate($date_format = 'j F Y, g:i a')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_gmdate(string $date_format = 'j F Y, g:i a')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $date = $this->get_date('U');
</span><span class="cx" style="display: block; padding: 0 10px"> if ($date === null) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -779,9 +770,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_updated_date
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_updated_gmdate($date_format = 'j F Y, g:i a')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_updated_gmdate(string $date_format = 'j F Y, g:i a')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $date = $this->get_updated_date('U');
</span><span class="cx" style="display: block; padding: 0 10px"> if ($date === null) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -822,7 +813,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rel The relationship of the link to return
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null Link URL
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_link($key = 0, $rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_link(int $key = 0, string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $this->get_links($rel);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($links && $links[$key] !== null) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -839,9 +830,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rel The relationship of links to return
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null Links found for the item (strings)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string>|null Links found for the item (strings)
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_links($rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_links(string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['links'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'] = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -848,27 +839,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'link') as $link) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($link['attribs']['']['href'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link));
</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"> foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'link') as $link) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($link['attribs']['']['href'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link));
</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"> if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'link')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0]));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'link')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0]));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'link')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0]));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'guid')) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0]));
</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">@@ -881,8 +872,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = &$this->data['links'][$key];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($key, 0, 41) === \SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY) {
- $this->data['links'][substr($key, 41)] = &$this->data['links'][$key];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (substr((string) $key, 0, 41) === \SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY) {
+ $this->data['links'][substr((string) $key, 41)] = &$this->data['links'][$key];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'][$key] = array_unique($this->data['links'][$key]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -904,7 +895,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1
</span><span class="cx" style="display: block; padding: 0 10px"> * @return \SimplePie\Enclosure|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_enclosure($key = 0, $prefer = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_enclosure(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $enclosures = $this->get_enclosures();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($enclosures[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -944,7 +935,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $keywords_parent = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $player_parent = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $ratings_parent = null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restrictions_parent = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restrictions_parent = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> $thumbnails_parent = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $title_parent = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1139,20 +1130,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"> // DURATION
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($duration_parent = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'duration')) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $duration_tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'duration');
+ if ($duration_tags !== null) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $seconds = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $minutes = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $hours = null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (isset($duration_parent[0]['data'])) {
- $temp = explode(':', $this->sanitize($duration_parent[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT));
- if (sizeof($temp) > 0) {
- $seconds = (int) array_pop($temp);
- }
- if (sizeof($temp) > 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isset($duration_tags[0]['data'])) {
+ $temp = explode(':', $this->sanitize($duration_tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT));
+ $seconds = (int) array_pop($temp);
+ if (count($temp) > 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $minutes = (int) array_pop($temp);
</span><span class="cx" style="display: block; padding: 0 10px"> $seconds += $minutes * 60;
</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 (sizeof($temp) > 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (count($temp) > 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $hours = (int) array_pop($temp);
</span><span class="cx" style="display: block; padding: 0 10px"> $seconds += $hours * 3600;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,11 +1226,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // PLAYER
</span><span class="cx" style="display: block; padding: 0 10px"> if ($player_parent = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'player')) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($player_parent[0]['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($player_parent[0]));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ($player_parent = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'player')) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($player_parent[0]['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($player_parent[0]));
</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">@@ -1315,11 +1305,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ($restrictions = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'block')) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($restrictions as $restriction) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restriction_relationship = 'allow';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restriction_relationship = Restriction::RELATIONSHIP_ALLOW;
</ins><span class="cx" style="display: block; padding: 0 10px"> $restriction_type = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $restriction_value = 'itunes';
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restriction_relationship = 'deny';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restriction_relationship = Restriction::RELATIONSHIP_DENY;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1341,19 +1331,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ($restrictions = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'block')) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($restrictions as $restriction) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restriction_relationship = 'allow';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restriction_relationship = Restriction::RELATIONSHIP_ALLOW;
</ins><span class="cx" style="display: block; padding: 0 10px"> $restriction_type = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $restriction_value = 'itunes';
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restriction_relationship = 'deny';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restriction_relationship = Restriction::RELATIONSHIP_DENY;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]);
</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 (is_array($restrictions_parent)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (count($restrictions_parent) > 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $restrictions_parent = array_values(array_unique($restrictions_parent));
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $restrictions_parent = [new \SimplePie\Restriction('allow', null, 'default')];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $restrictions_parent = [new \SimplePie\Restriction(Restriction::RELATIONSHIP_ALLOW, null, 'default')];
</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"> // THUMBNAILS
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1360,13 +1350,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($thumbnails = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'thumbnail')) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($thumbnails as $thumbnail) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($thumbnail['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail));
</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"> } elseif ($thumbnails = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'thumbnail')) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($thumbnails as $thumbnail) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($thumbnail['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail));
</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">@@ -1490,7 +1480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['attribs']['']['width'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $width = $this->sanitize($content['attribs']['']['width'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</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->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $this->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($content));
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1749,9 +1739,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // PLAYER
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $player = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $playerElem = $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0];
+ $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem));
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $player = $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $playerElem = $group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0];
+ $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $player = $player_parent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1841,7 +1833,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // THUMBNAILS
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_array($thumbnails)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnails = array_values(array_unique($thumbnails));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1848,7 +1840,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_array($thumbnails)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnails = array_values(array_unique($thumbnails));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1946,7 +1938,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $width = $this->sanitize($content['attribs']['']['width'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $this->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($content));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2101,7 +2093,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // PLAYER
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $player = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $playerElem = $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0];
+ $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $player = $player_parent;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2157,7 +2150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($thumbnail['attribs']['']['url'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail));
</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"> if (is_array($thumbnails)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2197,7 +2190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $width = null;
</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->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link));
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isset($link['attribs']['']['type'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->sanitize($link['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2233,7 +2226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $width = null;
</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->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link));
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isset($link['attribs']['']['type'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->sanitize($link['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2264,8 +2257,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $width = null;
</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->sanitize($enclosure['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($enclosure));
- $url = $this->feed->sanitize->https_url($url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $this->sanitize($enclosure['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($enclosure));
+ $url = $this->get_sanitize()->https_url($url);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isset($enclosure['attribs']['']['type'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->sanitize($enclosure['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2278,7 +2271,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (count($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) {
</ins><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="cx" style="display: block; padding: 0 10px"> $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2302,7 +2295,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.georss.org/ GeoRSS
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return float|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_latitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2325,7 +2318,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.georss.org/ GeoRSS
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return float|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_longitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2354,6 +2347,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ public function set_sanitize(Sanitize $sanitize): void
+ {
+ $this->sanitize = $sanitize;
+ }
+
+ protected function get_sanitize(): Sanitize
+ {
+ if ($this->sanitize === null) {
+ $this->sanitize = new Sanitize();
+ }
+
+ return $this->sanitize;
+ }
</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"> class_alias('SimplePie\Item', 'SimplePie_Item');
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcLocatorphp"></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/src/Locator.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Locator.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Locator.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,76 +1,70 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use DomDocument;
+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\UriFactoryInterface;
+use SimplePie\HTTP\Client;
+use SimplePie\HTTP\ClientException;
+use SimplePie\HTTP\FileClient;
+use SimplePie\HTTP\Psr18Client;
+use SimplePie\HTTP\Response;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Used for feed auto-discovery
</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"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_locator_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Locator implements RegistryAware
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $useragent;
- public $timeout;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var ?string */
+ public $useragent = null;
+ /** @var int */
+ public $timeout = 10;
+ /** @var File */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $file;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $local = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $elsewhere = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<mixed> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $cached_entities = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $http_base;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $base;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $base_location = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $checked_feeds = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $max_checked_feeds = 10;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $force_fsockopen = false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<int, mixed> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $curl_options = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var ?\DomDocument */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $dom;
</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"> protected $registry;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct(\SimplePie\File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @var Client|null
+ */
+ private $http_client = null;
+
+ /**
+ * @param array<int, mixed> $curl_options
+ */
+ public function __construct(File $file, int $timeout = 10, ?string $useragent = null, int $max_checked_feeds = 10, bool $force_fsockopen = false, array $curl_options = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->file = $file;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->useragent = $useragent;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,12 +73,14 @@
</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') && $this->file->body != '') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = $this->file->get_body_content();
+
+ if (class_exists('DOMDocument') && $body != '') {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->dom = new \DOMDocument();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_error_handler(['SimplePie\Misc', 'silence_errors']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_error_handler([Misc::class, 'silence_errors']);
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</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">+ $this->dom->loadHTML($body);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (\Throwable $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->dom = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,18 +90,41 @@
</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">- public function set_registry(\SimplePie\Registry $registry)/* : void */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Set a PSR-18 client and PSR-17 factories
+ *
+ * Allows you to use your own HTTP client implementations.
+ */
+ final public function set_http_client(
+ ClientInterface $http_client,
+ RequestFactoryInterface $request_factory,
+ UriFactoryInterface $uri_factory
+ ): void {
+ $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory);
+ }
+
+ /**
+ * @return void
+ */
+ public function set_registry(\SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry = $registry;
</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">- public function find($type = \SimplePie\SimplePie::LOCATOR_ALL, &$working = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param SimplePie::LOCATOR_* $type
+ * @param array<Response>|null $working
+ * @return Response|null
+ */
+ public function find(int $type = \SimplePie\SimplePie::LOCATOR_ALL, ?array &$working = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->is_feed($this->file)) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->file;
</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 ($this->file->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Misc::is_remote_uri($this->file->get_final_requested_uri())) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sniffer = $this->registry->create(Content\Type\Sniffer::class, [$this->file]);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($sniffer->get_type() !== 'text/html') {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,9 +159,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function is_feed($file, $check_html = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return bool
+ */
+ public function is_feed(Response $file, bool $check_html = false)
</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 ($file->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
+ if (Misc::is_remote_uri($file->get_final_requested_uri())) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sniffer = $this->registry->create(Content\Type\Sniffer::class, [$file]);
</span><span class="cx" style="display: block; padding: 0 10px"> $sniffed = $sniffer->get_type();
</span><span class="cx" style="display: block; padding: 0 10px"> $mime_types = ['application/rss+xml', 'application/rdf+xml',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +177,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"> return in_array($sniffed, $mime_types);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ($file->method & \SimplePie\SimplePie::FILE_SOURCE_LOCAL) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (is_file($file->get_final_requested_uri())) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,12 +184,17 @@
</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 void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_base()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->dom === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new \SimplePie\Exception('DOMDocument not found, unable to use locator');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->http_base = $this->file->url;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->http_base = $this->file->get_final_requested_uri();
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->base = $this->http_base;
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = $this->dom->getElementsByTagName('base');
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,6 +210,9 @@
</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 array<Response>|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function autodiscovery()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $done = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,8 +228,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- protected function search_elements_by_tag($name, &$done, $feeds)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string[] $done
+ * @param array<string, Response> $feeds
+ * @return array<string, Response>
+ */
+ protected function search_elements_by_tag(string $name, array &$done, array $feeds)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->dom === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new \SimplePie\Exception('DOMDocument not found, unable to use locator');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,11 +262,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call(Misc::class, 'parse_mime', [$link->getAttribute('type')])), ['text/html', 'application/rss+xml', 'application/atom+xml'])) && !isset($feeds[$href])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->checked_feeds++;
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER,
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $feed = $this->registry->create(File::class, [$href, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options]);
- if ($feed->success && ($feed->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed, true)) {
- $feeds[$href] = $feed;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ try {
+ $feed = $this->get_http_client()->request(Client::METHOD_GET, $href, $headers);
+
+ if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed, true)) {
+ $feeds[$href] = $feed;
+ }
+ } catch (ClientException $th) {
+ // Just mark it as done and continue.
</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"> $done[] = $href;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,8 +282,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $feeds;
</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 true|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_links()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->dom === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new \SimplePie\Exception('DOMDocument not found, unable to use locator');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">- $current = $this->registry->call(Misc::class, 'parse_url', [$this->file->url]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current = $this->registry->call(Misc::class, 'parse_url', [$this->file->get_final_requested_uri()]);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->local[] = $href;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,8 +326,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_rel_link($rel)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Extracts first `link` element with given `rel` attribute inside the `head` element.
+ *
+ * @return string|null
+ */
+ public function get_rel_link(string $rel)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($this->registry !== null);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->dom === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new \SimplePie\Exception('DOMDocument not found, unable to use '.
</span><span class="cx" style="display: block; padding: 0 10px"> 'locator');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,8 +345,10 @@
</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"> $xpath = new \DOMXpath($this->dom);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $query = '//a[@rel and @href] | //link[@rel and @href]';
- foreach ($xpath->query($query) as $link) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $query = '(//head)[1]/link[@rel and @href]';
+ /** @var \DOMNodeList<\DOMElement> */
+ $queryResult = $xpath->query($query);
+ foreach ($queryResult as $link) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $href = trim($link->getAttribute('href'));
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed = $this->registry->call(Misc::class, 'parse_url', [$href]);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($parsed['scheme'] === '' ||
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,33 +376,49 @@
</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">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function extension(&$array)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string[] $array
+ * @return array<Response>|null
+ */
+ public function extension(array &$array)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($array as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->checked_feeds === $this->max_checked_feeds) {
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</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 (in_array(strtolower(strrchr($value, '.')), ['.rss', '.rdf', '.atom', '.xml'])) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $extension = strrchr($value, '.');
+ if ($extension !== false && in_array(strtolower($extension), ['.rss', '.rdf', '.atom', '.xml'])) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->checked_feeds++;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER,
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $feed = $this->registry->create(File::class, [$value, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options]);
- if ($feed->success && ($feed->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) {
- return [$feed];
- } else {
- unset($array[$key]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ try {
+ $feed = $this->get_http_client()->request(Client::METHOD_GET, $value, $headers);
+
+ if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed)) {
+ return [$feed];
+ }
+ } catch (ClientException $th) {
+ // Just unset and continue.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ unset($array[$key]);
</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"> return null;
</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">- public function body(&$array)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string[] $array
+ * @return array<Response>|null
+ */
+ public function body(array &$array)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($array as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->checked_feeds === $this->max_checked_feeds) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,18 +427,52 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (preg_match('/(feed|rss|rdf|atom|xml)/i', $value)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->checked_feeds++;
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER,
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $feed = $this->registry->create(File::class, [$value, $this->timeout, 5, null, $this->useragent, $this->force_fsockopen, $this->curl_options]);
- if ($feed->success && ($feed->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) {
- return [$feed];
- } else {
- unset($array[$key]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ try {
+ $feed = $this->get_http_client()->request(Client::METHOD_GET, $value, $headers);
+
+ if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed)) {
+ return [$feed];
+ }
+ } catch (ClientException $th) {
+ // Just unset and continue.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ unset($array[$key]);
</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"> return null;
</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 a HTTP client
+ */
+ private function get_http_client(): Client
+ {
+ assert($this->registry !== null);
+
+ if ($this->http_client === null) {
+ $options = [
+ 'timeout' => $this->timeout,
+ 'redirects' => 5,
+ 'force_fsockopen' => $this->force_fsockopen,
+ 'curl_options' => $this->curl_options,
+ ];
+
+ if ($this->useragent !== null) {
+ $options['useragent'] = $this->useragent;
+ }
+
+ return new FileClient(
+ $this->registry,
+ $options
+ );
+ }
+
+ return $this->http_client;
+ }
</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"> class_alias('SimplePie\Locator', 'SimplePie_Locator', false);
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcMiscphp"></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/src/Misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Misc.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Misc.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\XML\Declaration\Parser;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,14 +11,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"> * Miscellaneous utilities
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Misc
</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|null */
</ins><span class="cx" style="display: block; padding: 0 10px"> private static $SIMPLEPIE_BUILD = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function time_hms($seconds)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
+ public static function time_hms(int $seconds)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $time = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +45,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $time;
</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">- public static function absolutize_url($relative, $base)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string|false
+ */
+ public static function absolutize_url(string $relative, string $base)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $iri = \SimplePie\IRI::absolutize(new \SimplePie\IRI($base), $relative);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($iri === false) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,14 +58,22 @@
</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">+ * @internal
+ */
+ public static function is_remote_uri(string $uri): bool
+ {
+ return preg_match('/^https?:\/\//i', $uri) === 1;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Get a HTML/XML element from a HTML string
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use DOMDocument instead (parsing HTML with regex is bad!)
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $realname Element name (including namespace prefix if applicable)
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $string HTML document
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<array{tag: string, self_closing: bool, attribs: array<string, array{data: string}>, content?: string}>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function get_element($realname, $string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function get_element(string $realname, string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.3, use "DOMDocument" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,11 +92,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $return[$i]['attribs'] = [];
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) {
- if (count($attribs[$j]) === 2) {
- $attribs[$j][2] = $attribs[$j][1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ($attribs as $attrib) {
+ if (count($attrib) === 2) {
+ $attrib[2] = $attrib[1];
</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[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = Misc::entities_decode(end($attribs[$j]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $return[$i]['attribs'][strtolower($attrib[1])]['data'] = Misc::entities_decode(end($attrib));
</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">@@ -128,9 +104,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $return;
</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">- public static function element_implode($element)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling.
+ * @param array{tag: string, self_closing: bool, attribs: array<string, array{data: string}>, content: string} $element
+ * @return string
+ */
+ public static function element_implode(array $element)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $full = "<$element[tag]";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);
+
+ $full = "<{$element['tag']}";
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($element['attribs'] as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> $key = strtolower($key);
</span><span class="cx" style="display: block; padding: 0 10px"> $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,12 +121,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($element['self_closing']) {
</span><span class="cx" style="display: block; padding: 0 10px"> $full .= ' />';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $full .= ">$element[content]</$element[tag]>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $full .= ">{$element['content']}</{$element['tag']}>";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $full;
</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">- public static function error($message, $level, $file, $line)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $message
+ * @param int $level
+ * @param string $file
+ * @param int $line
+ * @return string
+ */
+ public static function error(string $message, int $level, string $file, int $line)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ((error_reporting() & $level) > 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ($level) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +169,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $message;
</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">- public static function fix_protocol($url, $http = 1)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
+ public static function fix_protocol(string $url, int $http = 1)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = Misc::normalize_url($url);
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed = Misc::parse_url($url);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,8 +197,11 @@
</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"> * @deprecated since SimplePie 1.8.0, use PHP native array_replace_recursive() instead.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $array1
+ * @param array<mixed> $array2
+ * @return array<mixed>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function array_merge_recursive($array1, $array2)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function array_merge_recursive(array $array1, array $array2)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($array2 as $key => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_array($value)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +214,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $array1;
</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">- public static function parse_url($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return array<string, string>
+ */
+ public static function parse_url(string $url)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $iri = new \SimplePie\IRI($url);
</span><span class="cx" style="display: block; padding: 0 10px"> return [
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,7 +229,10 @@
</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">- public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
+ public static function compress_parse_url(string $scheme = '', string $authority = '', string $path = '', string $query = '', ?string $fragment = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $iri = new \SimplePie\IRI('');
</span><span class="cx" style="display: block; padding: 0 10px"> $iri->scheme = $scheme;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -241,17 +243,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $iri->get_uri();
</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">- public static function normalize_url($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
+ public static function normalize_url(string $url)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $iri = new \SimplePie\IRI($url);
</span><span class="cx" style="display: block; padding: 0 10px"> return $iri->get_uri();
</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">- public static function percent_encoding_normalization($match)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @deprecated since SimplePie 1.9.0. This functionality is part of `IRI` – if you need it standalone, consider copying the function to your codebase.
+ * @param array<int, string> $match
+ * @return string
+ */
+ public static function percent_encoding_normalization(array $match)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $integer = hexdec($match[1]);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return chr($integer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan, the value would only be float when above PHP_INT_MAX, which would not go in this branch.
+ return chr((int) $integer);
</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"> return strtoupper($match[0]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $string Windows-1252 encoded string
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string UTF-8 encoded string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function windows_1252_to_utf8($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function windows_1252_to_utf8(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $convert_table = ["\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\
x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA
8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE"
=> "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" =>
"\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\
xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,9 +288,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Raw data in $input encoding
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $input Encoding of $data
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Encoding you want
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|boolean False if we can't convert it
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false False if we can't convert it
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function change_encoding($data, $input, $output)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function change_encoding(string $data, string $input, string $output)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = Misc::encoding($input);
</span><span class="cx" style="display: block; padding: 0 10px"> $output = Misc::encoding($output);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,13 +297,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // We fail to fail on non US-ASCII bytes
</span><span class="cx" style="display: block; padding: 0 10px"> if ($input === 'US-ASCII') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static $non_ascii_octects = '';
- if (!$non_ascii_octects) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static $non_ascii_octets = '';
+ if (!$non_ascii_octets) {
</ins><span class="cx" style="display: block; padding: 0 10px"> for ($i = 0x80; $i <= 0xFF; $i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $non_ascii_octects .= chr($i);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $non_ascii_octets .= chr($i);
</ins><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">- $data = substr($data, 0, strcspn($data, $non_ascii_octects));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = substr($data, 0, strcspn($data, $non_ascii_octets));
</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"> // This is first, as behaviour of this is completely predictable
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +327,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- protected static function change_encoding_mbstring($data, $input, $output)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string|false
+ */
+ protected static function change_encoding_mbstring(string $data, string $input, string $output)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($input === 'windows-949') {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'EUC-KR';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,18 +362,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- protected static function change_encoding_iconv($data, $input, $output)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string|false
+ */
+ protected static function change_encoding_iconv(string $data, string $input, string $output)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return @iconv($input, $output, $data);
</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">- * @param string $data
- * @param string $input
- * @param string $output
</del><span class="cx" style="display: block; padding: 0 10px"> * @return string|false
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected static function change_encoding_uconverter($data, $input, $output)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected static function change_encoding_uconverter(string $data, string $input, string $output)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return @\UConverter::transcode($data, $output, $input);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,10 +389,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $charset Character set to standardise
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Standardised name
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function encoding($charset)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function encoding(string $charset)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Normalization from UTS #22
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan, the regex should not fail.
+ switch (strtolower((string) preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'adobestandardencoding':
</span><span class="cx" style="display: block; padding: 0 10px"> case 'csadobestandardencoding':
</span><span class="cx" style="display: block; padding: 0 10px"> return 'Adobe-Standard-Encoding';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1687,16 +1702,15 @@
</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 string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public static function get_curl_version()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_array($curl = curl_version())) {
</span><span class="cx" style="display: block; padding: 0 10px"> $curl = $curl['version'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif (substr($curl, 0, 5) === 'curl/') {
- $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
- } elseif (substr($curl, 0, 8) === 'libcurl/') {
- $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
</del><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $curl = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $curl = '0';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $curl;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1704,11 +1718,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Strip HTML comments
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Data to strip comments from
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Comment stripped string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function strip_comments($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function strip_comments(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> while (($start = strpos($data, '<!--')) !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= substr($data, 0, $start);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1721,7 +1738,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $output . $data;
</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">- public static function parse_date($dt)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return int|false
+ */
+ public static function parse_date(string $dt)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = \SimplePie\Parse\Date::get();
</span><span class="cx" style="display: block; padding: 0 10px"> return $parser->parse($dt);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1734,7 +1754,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Input data
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Output data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function entities_decode($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function entities_decode(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.3, use "DOMDocument" instead.'), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1745,12 +1765,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Remove RFC822 comments
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $data Data to strip comments from
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase.
+ * @param string $string Data to strip comments from
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Comment stripped string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function uncomment_rfc822($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function uncomment_rfc822(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $string = (string) $string;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $position = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $length = strlen($string);
</span><span class="cx" style="display: block; padding: 0 10px"> $depth = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1791,7 +1813,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</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">- public static function parse_mime($mime)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
+ public static function parse_mime(string $mime)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (($pos = strpos($mime, ';')) === false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return trim($mime);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1800,7 +1825,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return trim(substr($mime, 0, $pos));
</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">- public static function atom_03_construct_type($attribs)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, array<string, string>> $attribs
+ * @return int-mask-of<SimplePie::CONSTRUCT_*>
+ */
+ public static function atom_03_construct_type(array $attribs)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode'])) === 'base64') {
</span><span class="cx" style="display: block; padding: 0 10px"> $mode = \SimplePie\SimplePie::CONSTRUCT_BASE64;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1829,7 +1858,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return \SimplePie\SimplePie::CONSTRUCT_TEXT | $mode;
</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">- public static function atom_10_construct_type($attribs)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, array<string, string>> $attribs
+ * @return int-mask-of<SimplePie::CONSTRUCT_*>
+ */
+ public static function atom_10_construct_type(array $attribs)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($attribs['']['type'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch (strtolower(trim($attribs['']['type']))) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1849,7 +1882,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return \SimplePie\SimplePie::CONSTRUCT_TEXT;
</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">- public static function atom_10_content_construct_type($attribs)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, array<string, string>> $attribs
+ * @return int-mask-of<SimplePie::CONSTRUCT_*>
+ */
+ public static function atom_10_content_construct_type(array $attribs)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($attribs['']['type'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = strtolower(trim($attribs['']['type']));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1873,12 +1910,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return \SimplePie\SimplePie::CONSTRUCT_TEXT;
</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">- public static function is_isegment_nz_nc($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return bool
+ */
+ public static function is_isegment_nz_nc(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
</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">- public static function space_separated_tokens($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string[]
+ */
+ public static function space_separated_tokens(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
</span><span class="cx" style="display: block; padding: 0 10px"> $string_length = strlen($string);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1901,11 +1944,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @static
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $codepoint Unicode codepoint
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string UTF-8 character
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false UTF-8 character
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function codepoint_to_utf8($codepoint)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function codepoint_to_utf8(int $codepoint)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $codepoint = (int) $codepoint;
</del><span class="cx" style="display: block; padding: 0 10px"> if ($codepoint < 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ($codepoint <= 0x7f) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1928,12 +1970,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns an associative array of name/value pairs, where the value is an
</span><span class="cx" style="display: block; padding: 0 10px"> * array of values that have used the same name
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @static
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $str The input string.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string, array<string|null>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function parse_str($str)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function parse_str(string $str)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $return = [];
</span><span class="cx" style="display: block; padding: 0 10px"> $str = explode('&', $str);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1955,9 +2000,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo Add support for EBCDIC
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data XML data
</span><span class="cx" style="display: block; padding: 0 10px"> * @param \SimplePie\Registry $registry Class registry
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array Possible encodings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string> Possible encodings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function xml_encoding($data, $registry)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function xml_encoding(string $data, \SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // UTF-32 Big Endian BOM
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2036,6 +2081,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $encoding;
</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 void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public static function output_javascript()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (function_exists('ob_gzhandler')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2045,7 +2093,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> header('Cache-Control: must-revalidate');
</span><span class="cx" style="display: block; padding: 0 10px"> header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $body = <<<END
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $body = <<<JS
</ins><span class="cx" style="display: block; padding: 0 10px"> function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (placeholder != '') {
</span><span class="cx" style="display: block; padding: 0 10px"> document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2066,7 +2114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function embed_wmedia(width, height, link) {
</span><span class="cx" style="display: block; padding: 0 10px"> document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-END;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+JS;
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $body;
</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">@@ -2075,37 +2123,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses the git index if it exists, otherwise uses the modification time
</span><span class="cx" style="display: block; padding: 0 10px"> * of the newest file.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return int
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_build()
</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 (static::$SIMPLEPIE_BUILD !== null) {
- return static::$SIMPLEPIE_BUILD;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self::$SIMPLEPIE_BUILD !== null) {
+ return self::$SIMPLEPIE_BUILD;
</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"> $root = dirname(__FILE__, 2);
</span><span class="cx" style="display: block; padding: 0 10px"> if (file_exists($root . '/.git/index')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static::$SIMPLEPIE_BUILD = filemtime($root . '/.git/index');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::$SIMPLEPIE_BUILD = (int) filemtime($root . '/.git/index');
</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 static::$SIMPLEPIE_BUILD;
- } elseif (file_exists($root . '/SimplePie')) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self::$SIMPLEPIE_BUILD;
+ } elseif (file_exists($root . '/src')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $time = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach (glob($root . '/SimplePie/*.php') as $file) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach (glob($root . '/src/*.php') ?: [] as $file) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (($mtime = filemtime($file)) > $time) {
</span><span class="cx" style="display: block; padding: 0 10px"> $time = $mtime;
</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">- static::$SIMPLEPIE_BUILD = $time;
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return static::$SIMPLEPIE_BUILD;
- } elseif (file_exists(dirname(__FILE__) . '/Core.php')) {
- static::$SIMPLEPIE_BUILD = filemtime(dirname(__FILE__) . '/Core.php');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::$SIMPLEPIE_BUILD = $time;
</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 static::$SIMPLEPIE_BUILD;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self::$SIMPLEPIE_BUILD;
</ins><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">- static::$SIMPLEPIE_BUILD = filemtime(__FILE__);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::$SIMPLEPIE_BUILD = (int) filemtime(__FILE__);
</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 static::$SIMPLEPIE_BUILD;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self::$SIMPLEPIE_BUILD;
</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">@@ -2120,13 +2167,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"> * Format debugging information
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function debug(&$sp)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function debug(SimplePie &$sp)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $info = 'SimplePie ' . \SimplePie\SimplePie::VERSION . ' Build ' . static::get_build() . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $info .= 'PHP ' . PHP_VERSION . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> if ($sp->error() !== null) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $info .= 'Error occurred: ' . $sp->error() . "\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // TODO: Remove cast with multifeeds.
+ $info .= 'Error occurred: ' . implode(', ', (array) $sp->error()) . "\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $info .= "No error found.\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2140,12 +2190,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info .= ' Version ' . PCRE_VERSION . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'curl':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $version = curl_version();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $version = (array) curl_version();
</ins><span class="cx" style="display: block; padding: 0 10px"> $info .= ' Version ' . $version['version'] . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'mbstring':
- $info .= ' Overloading: ' . mb_get_info('func_overload') . "\n";
- break;
</del><span class="cx" style="display: block; padding: 0 10px"> case 'iconv':
</span><span class="cx" style="display: block; padding: 0 10px"> $info .= ' Version ' . ICONV_VERSION . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2160,9 +2207,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $info;
</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">- public static function silence_errors($num, $str)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return bool
+ */
+ public static function silence_errors(int $num, string $str)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // No-op
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return true;
</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">@@ -2170,9 +2221,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url the URL to sanitize.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string the same URL without HTTP credentials.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function url_remove_credentials($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function url_remove_credentials(string $url)
</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 preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan: I do not think this can fail.
+ // The regex is valid and there should be no backtracking.
+ // https://github.com/phpstan/phpstan/issues/11547
+ return (string) preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
</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></pre></div>
<a id="trunksrcwpincludesSimplePiesrcNetIPv6php"></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/src/Net/IPv6.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Net/IPv6.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Net/IPv6.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Net;
</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"> * Class to validate and to work with IPv6 addresses.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
- * @subpackage HTTP
</del><span class="cx" style="display: block; padding: 0 10px"> * @copyright 2003-2005 The PHP Group
</span><span class="cx" style="display: block; padding: 0 10px"> * @license http://www.opensource.org/licenses/bsd-license.php
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://pear.php.net/package/Net_IPv6
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Uncompresses an IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * RFC 4291 allows you to compress concecutive zero pieces in an address to
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * RFC 4291 allows you to compress consecutive zero pieces in an address to
</ins><span class="cx" style="display: block; padding: 0 10px"> * '::'. This method expects a valid IPv6 address and expands the '::' to
</span><span class="cx" style="display: block; padding: 0 10px"> * the required number of zero pieces.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ip An IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The uncompressed IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function uncompress($ip)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function uncompress(string $ip)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $c1 = -1;
</span><span class="cx" style="display: block; padding: 0 10px"> $c2 = -1;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Compresses an IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * RFC 4291 allows you to compress concecutive zero pieces in an address to
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * RFC 4291 allows you to compress consecutive zero pieces in an address to
</ins><span class="cx" style="display: block; padding: 0 10px"> * '::'. This method expects a valid IPv6 address and compresses consecutive
</span><span class="cx" style="display: block; padding: 0 10px"> * zero pieces to '::'.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ip An IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The compressed IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function compress($ip)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function compress(string $ip)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Prepare the IP to be compressed
</span><span class="cx" style="display: block; padding: 0 10px"> $ip = self::uncompress($ip);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ip_parts = self::split_v6_v4($ip);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Replace all leading zeros
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $ip_parts[0] = (string) preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Find bunches of zeros
</span><span class="cx" style="display: block; padding: 0 10px"> if (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,6 +114,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">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($pos !== null, 'For PHPStan: Since the regex matched, there is at least one match. And because the pattern is non-empty, the loop will always end with $pos ≥ 1.');
</ins><span class="cx" style="display: block; padding: 0 10px"> $ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max);
</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">@@ -173,12 +135,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * 0:0:0:0:0:FFFF:129.144.52.38
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ip An IPv6 address
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array{string, string} [0] contains the IPv6 represented part, and [1] the IPv4 represented part
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private static function split_v6_v4($ip)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private static function split_v6_v4(string $ip): array
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (strpos($ip, '.') !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $pos = strrpos($ip, ':');
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ assert($pos !== false, 'For PHPStan: IPv6 address must contain colon, since split_v6_v4 is only ever called after uncompress.');
</ins><span class="cx" style="display: block; padding: 0 10px"> $ipv6_part = substr($ip, 0, $pos);
</span><span class="cx" style="display: block; padding: 0 10px"> $ipv4_part = substr($ip, $pos + 1);
</span><span class="cx" style="display: block; padding: 0 10px"> return [$ipv6_part, $ipv4_part];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,7 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ip An IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool true if $ip is a valid IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function check_ipv6($ip)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function check_ipv6(string $ip)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $ip = self::uncompress($ip);
</span><span class="cx" style="display: block; padding: 0 10px"> [$ipv6, $ipv4] = self::split_v6_v4($ip);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,9 +184,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the value is valid
</span><span class="cx" style="display: block; padding: 0 10px"> $value = hexdec($ipv6_part);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($value < 0 || $value > 0xFFFF) {
</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">+ assert(is_int($value), 'For PHPStan: $value is only float when $ipv6_part > PHP_INT_MAX');
+ if (dechex($value) !== strtolower($ipv6_part)) {
+ return false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (count($ipv4) === 4) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($ipv4 as $ipv4_part) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ip An IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool true if $ip is a valid IPv6 address
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function checkIPv6($ip)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function checkIPv6(string $ip)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return self::check_ipv6($ip);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcParseDatephp"></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/src/Parse/Date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Parse/Date.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Parse/Date.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\Parse;
</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"> * Date Parser
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage Parsing
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Date
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * List of days, calendar day name => ordinal day number in the week
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, int<1,7>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $day = [
</span><span class="cx" style="display: block; padding: 0 10px"> // English
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * List of months, calendar month name => calendar month number
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, int<1,12>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $month = [
</span><span class="cx" style="display: block; padding: 0 10px"> // English
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,15 +161,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'januari' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'februari' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> 'maart' => 3,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'april' => 4,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'april' => 4,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'mei' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'juni' => 6,
</span><span class="cx" style="display: block; padding: 0 10px"> 'juli' => 7,
</span><span class="cx" style="display: block; padding: 0 10px"> 'augustus' => 8,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'september' => 9,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'september' => 9,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'oktober' => 10,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'november' => 11,
- 'december' => 12,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'november' => 11,
+ // 'december' => 12,
</ins><span class="cx" style="display: block; padding: 0 10px"> // French
</span><span class="cx" style="display: block; padding: 0 10px"> 'janvier' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'février' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,26 +185,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'décembre' => 12,
</span><span class="cx" style="display: block; padding: 0 10px"> // German
</span><span class="cx" style="display: block; padding: 0 10px"> 'januar' => 1,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'jan' => 1,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'jan' => 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'februar' => 2,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'feb' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'feb' => 2,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'märz' => 3,
</span><span class="cx" style="display: block; padding: 0 10px"> 'mär' => 3,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'april' => 4,
- 'apr' => 4,
- 'mai' => 5, // no short form for may
- 'juni' => 6,
- 'jun' => 6,
- 'juli' => 7,
- 'jul' => 7,
- 'august' => 8,
- 'aug' => 8,
- 'september' => 9,
- 'sep' => 9,
- 'oktober' => 10,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'april' => 4,
+ // 'apr' => 4,
+ // 'mai' => 5, // no short form for may
+ // 'juni' => 6,
+ // 'jun' => 6,
+ // 'juli' => 7,
+ // 'jul' => 7,
+ // 'august' => 8,
+ // 'aug' => 8,
+ // 'september' => 9,
+ // 'sep' => 9,
+ // 'oktober' => 10,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'okt' => 10,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'november' => 11,
- 'nov' => 11,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'november' => 11,
+ // 'nov' => 11,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'dezember' => 12,
</span><span class="cx" style="display: block; padding: 0 10px"> 'dez' => 12,
</span><span class="cx" style="display: block; padding: 0 10px"> // Italian
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,17 +218,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'agosto' => 8,
</span><span class="cx" style="display: block; padding: 0 10px"> 'settembre' => 9,
</span><span class="cx" style="display: block; padding: 0 10px"> 'ottobre' => 10,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'novembre' => 11,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'novembre' => 11,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'dicembre' => 12,
</span><span class="cx" style="display: block; padding: 0 10px"> // Spanish
</span><span class="cx" style="display: block; padding: 0 10px"> 'enero' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'febrero' => 2,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'marzo' => 3,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'marzo' => 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'abril' => 4,
</span><span class="cx" style="display: block; padding: 0 10px"> 'mayo' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'junio' => 6,
</span><span class="cx" style="display: block; padding: 0 10px"> 'julio' => 7,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'agosto' => 8,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'agosto' => 8,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'septiembre' => 9,
</span><span class="cx" style="display: block; padding: 0 10px"> 'setiembre' => 9,
</span><span class="cx" style="display: block; padding: 0 10px"> 'octubre' => 10,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,8 +258,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'augusztus' => 8,
</span><span class="cx" style="display: block; padding: 0 10px"> 'szeptember' => 9,
</span><span class="cx" style="display: block; padding: 0 10px"> 'október' => 10,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'november' => 11,
- 'december' => 12,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'november' => 11,
+ // 'december' => 12,
</ins><span class="cx" style="display: block; padding: 0 10px"> // Greek
</span><span class="cx" style="display: block; padding: 0 10px"> 'Ιαν' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'Φεβ' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,7 +311,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * List of timezones, abbreviation => offset from UTC
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, int>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $timezone = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'ACDT' => 37800,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,7 +382,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'GILT' => 43200,
</span><span class="cx" style="display: block; padding: 0 10px"> 'GIT' => -32400,
</span><span class="cx" style="display: block; padding: 0 10px"> 'GST' => 14400,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'GST' => -7200,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 'GST' => -7200,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'GYT' => -14400,
</span><span class="cx" style="display: block; padding: 0 10px"> 'HAA' => -10800,
</span><span class="cx" style="display: block; padding: 0 10px"> 'HAC' => -18000,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,7 +536,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of user-added callback methods
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $built_in = [];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -584,7 +544,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of user-added callback methods
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<callable(string): (int|false)>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $user = [];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -619,6 +579,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the object
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Date
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -635,18 +596,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @final
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $date Date to parse
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp corresponding to date string, or false on failure
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false Timestamp corresponding to date string, or false on failure
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function parse($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function parse(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($this->user as $method) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (($returned = call_user_func($method, $date)) !== false) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $returned;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (int) $returned;
</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="cx" style="display: block; padding: 0 10px"> foreach ($this->built_in as $method) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (($returned = call_user_func([$this, $method], $date)) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // TODO: we should really check this in constructor but that would require private properties.
+ /** @var callable(string): (int|false) */
+ $callable = [$this, $method];
+ if (($returned = call_user_func($callable, $date)) !== false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $returned;
</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">@@ -660,14 +624,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @final
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @param callable $callback
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function add_callback($callback)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_callback(callable $callback)
</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 (is_callable($callback)) {
- $this->user[] = $callback;
- } else {
- trigger_error('User-supplied function must be a valid callback', E_USER_WARNING);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->user[] = $callback;
</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">@@ -676,9 +637,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * spaces to be used as the time separator (including more than one))
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $date
+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function date_w3cdtf($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function date_w3cdtf(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $pcre = <<<'PCRE'
</span><span class="cx" style="display: block; padding: 0 10px"> /
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,12 +711,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Remove RFC822 comments
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $data Data to strip comments from
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string Data to strip comments from
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Comment stripped string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function remove_rfc2822_comments($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function remove_rfc2822_comments(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $string = (string) $string;
</del><span class="cx" style="display: block; padding: 0 10px"> $position = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $length = strlen($string);
</span><span class="cx" style="display: block; padding: 0 10px"> $depth = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -799,9 +760,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse RFC2822's date format
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $date
+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function date_rfc2822($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function date_rfc2822(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $pcre;
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$pcre) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -834,20 +796,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 11: Alphabetic timezone
</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">+ $day = (int) $match[2];
</ins><span class="cx" style="display: block; padding: 0 10px"> // Find the month number
</span><span class="cx" style="display: block; padding: 0 10px"> $month = $this->month[strtolower($match[3])];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $year = (int) $match[4];
+ $hour = (int) $match[5];
+ $minute = (int) $match[6];
+ // Second is optional, if it is empty set it to zero
+ $second = (int) $match[7];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tz_sign = $match[8];
+ $tz_hour = (int) $match[9];
+ $tz_minute = (int) $match[10];
+ $tz_code = isset($match[11]) ? strtoupper($match[11]) : '';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Numeric timezone
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($match[8] !== '') {
- $timezone = $match[9] * 3600;
- $timezone += $match[10] * 60;
- if ($match[8] === '-') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($tz_sign !== '') {
+ $timezone = $tz_hour * 3600;
+ $timezone += $tz_minute * 60;
+ if ($tz_sign === '-') {
</ins><span class="cx" style="display: block; padding: 0 10px"> $timezone = 0 - $timezone;
</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"> // Character timezone
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elseif (isset($this->timezone[strtoupper($match[11])])) {
- $timezone = $this->timezone[strtoupper($match[11])];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ elseif (isset($this->timezone[$tz_code])) {
+ $timezone = $this->timezone[$tz_code];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Assume everything else to be -0000
</span><span class="cx" style="display: block; padding: 0 10px"> else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -855,20 +828,13 @@
</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"> // Deal with 2/3 digit years
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($match[4] < 50) {
- $match[4] += 2000;
- } elseif ($match[4] < 1000) {
- $match[4] += 1900;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($year < 50) {
+ $year += 2000;
+ } elseif ($year < 1000) {
+ $year += 1900;
</ins><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">- // Second is optional, if it is empty set it to zero
- if ($match[7] !== '') {
- $second = $match[7];
- } else {
- $second = 0;
- }
-
- return gmmktime(intval($match[5]), intval($match[6]), intval($second), intval($month), intval($match[2]), intval($match[4])) - $timezone;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone;
</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"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -878,9 +844,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse RFC850's date format
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $date
+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function date_rfc850($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function date_rfc850(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $pcre;
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$pcre) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -905,12 +872,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 8: Timezone
</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">+ $day = (int) $match[2];
</ins><span class="cx" style="display: block; padding: 0 10px"> // Month
</span><span class="cx" style="display: block; padding: 0 10px"> $month = $this->month[strtolower($match[3])];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $year = (int) $match[4];
+ $hour = (int) $match[5];
+ $minute = (int) $match[6];
+ // Second is optional, if it is empty set it to zero
+ $second = (int) $match[7];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tz_code = strtoupper($match[8]);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Character timezone
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (isset($this->timezone[strtoupper($match[8])])) {
- $timezone = $this->timezone[strtoupper($match[8])];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isset($this->timezone[$tz_code])) {
+ $timezone = $this->timezone[$tz_code];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Assume everything else to be -0000
</span><span class="cx" style="display: block; padding: 0 10px"> else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -918,13 +893,13 @@
</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"> // Deal with 2 digit year
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($match[4] < 50) {
- $match[4] += 2000;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($year < 50) {
+ $year += 2000;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $match[4] += 1900;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $year += 1900;
</ins><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">- return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone;
</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"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -934,9 +909,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse C99's asctime()'s date format
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $date
+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function date_asctime($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function date_asctime(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $pcre;
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$pcre) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -972,9 +948,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse dates using strtotime()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Timestamp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $date
+ * @return int|false Timestamp
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function date_strtotime($date)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function date_strtotime(string $date)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $strtotime = strtotime($date);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($strtotime === -1 || $strtotime === false) {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcParserphp"></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/src/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,50 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\XML\Declaration\Parser as DeclarationParser;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use XMLParser;
</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"> * Parses XML into something sane
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,35 +15,54 @@
</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"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_parser_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage Parsing
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Parser implements RegistryAware
</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 */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $error_code;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $error_string;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $current_line;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $current_column;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $current_byte;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $separator = ' ';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $namespace = [''];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $element = [''];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $xml_base = [''];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $xml_base_explicit = [false];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $xml_lang = [''];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<string, mixed> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $data = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<array<string, mixed>> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $datas = [[]];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $current_xhtml_construct = -1;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $encoding;
</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"> protected $registry;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_registry(\SimplePie\Registry $registry)/* : void */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function set_registry(\SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry = $registry;
</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">- public function parse(&$data, $encoding, $url = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return bool
+ */
+ public function parse(string &$data, string $encoding, string $url = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $doc = new \DOMDocument();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,6 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // and a list of entries without an h-feed wrapper are both valid.
</span><span class="cx" style="display: block; padding: 0 10px"> $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
</span><span class="cx" style="display: block; padding: 0 10px"> 'contains(concat(" ", @class, " "), " h-entry ")]';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var \DOMNodeList<\DOMElement> $result */
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $xpath->query($query);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($result->length !== 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->parse_microformats($data, $url);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,11 +112,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $declaration = $this->registry->create(DeclarationParser::class, [substr($data, 5, $pos - 5)]);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($declaration->parse()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = substr($data, $pos + 2);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . "\n" .
+ self::set_doctype($data);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->error_string = 'SimplePie bug! Please report this!';
</span><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">+ } else {
+ $data = self::set_doctype($data);
</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"> $return = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +128,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($xml_is_sane === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parser_check = xml_parser_create();
</span><span class="cx" style="display: block; padding: 0 10px"> xml_parse_into_struct($parser_check, '<foo>&</foo>', $values);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xml_parser_free($parser_check);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (\PHP_VERSION_ID < 80000) {
+ xml_parser_free($parser_check);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $xml_is_sane = isset($values[0]['value']);
</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">@@ -160,10 +149,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> rewind($stream)) {
</span><span class="cx" style="display: block; padding: 0 10px"> //Parse by chunks not to use too much memory
</span><span class="cx" style="display: block; padding: 0 10px"> do {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stream_data = fread($stream, 1048576);
- if (!xml_parse($xml, $stream_data === false ? '' : $stream_data, feof($stream))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stream_data = (string) fread($stream, 1048576);
+
+ if (!xml_parse($xml, $stream_data, feof($stream))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->error_code = xml_get_error_code($xml);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->error_string = xml_error_string($this->error_code);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->error_string = xml_error_string($this->error_code) ?: "Unknown";
</ins><span class="cx" style="display: block; padding: 0 10px"> $return = false;
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,7 +166,9 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xml_parser_free($xml);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (\PHP_VERSION_ID < 80000) {
+ xml_parser_free($xml);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return $return;
</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">@@ -185,7 +177,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml->xml($data);
</span><span class="cx" style="display: block; padding: 0 10px"> while (@$xml->read()) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ($xml->nodeType) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case constant('XMLReader::END_ELEMENT'):
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case \XMLReader::END_ELEMENT:
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($xml->namespaceURI !== '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $tagName = $xml->namespaceURI . $this->separator . $xml->localName;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->tag_close(null, $tagName);
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case constant('XMLReader::ELEMENT'):
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case \XMLReader::ELEMENT:
</ins><span class="cx" style="display: block; padding: 0 10px"> $empty = $xml->isEmptyElement;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($xml->namespaceURI !== '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $tagName = $xml->namespaceURI . $this->separator . $xml->localName;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,9 +206,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->tag_close(null, $tagName);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case constant('XMLReader::TEXT'):
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case \XMLReader::TEXT:
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case constant('XMLReader::CDATA'):
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case \XMLReader::CDATA:
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cdata(null, $xml->value);
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,37 +224,60 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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 int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_error_code()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->error_code;
</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 string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_error_string()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->error_string;
</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 int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_current_line()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->current_line;
</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 int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_current_column()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->current_column;
</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 int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_current_byte()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->current_byte;
</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 array<string, mixed>
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_data()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->data;
</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">- public function tag_open($parser, $tag, $attributes)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param XMLParser|resource|null $parser
+ * @param array<string, string> $attributes
+ * @return void
+ */
+ public function tag_open($parser, string $tag, array $attributes)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> [$this->namespace[], $this->element[]] = $this->split_ns($tag);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -279,7 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->xml_base_explicit[] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->xml_base[] = end($this->xml_base);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->xml_base[] = end($this->xml_base) ?: '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->xml_base_explicit[] = end($this->xml_base_explicit);
</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">@@ -286,7 +301,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($attribs[\SimplePie\SimplePie::NAMESPACE_XML]['lang'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->xml_lang[] = $attribs[\SimplePie\SimplePie::NAMESPACE_XML]['lang'];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->xml_lang[] = end($this->xml_lang);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->xml_lang[] = end($this->xml_lang) ?: '';
</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"> if ($this->current_xhtml_construct >= 0) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,7 +329,11 @@
</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">- public function cdata($parser, $cdata)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param XMLParser|resource|null $parser
+ * @return void
+ */
+ public function cdata($parser, string $cdata)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->current_xhtml_construct >= 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,7 +342,11 @@
</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">- public function tag_close($parser, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param XMLParser|resource|null $parser
+ * @return void
+ */
+ public function tag_close($parser, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->current_xhtml_construct >= 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->current_xhtml_construct--;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,7 +366,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array_pop($this->xml_lang);
</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">- public function split_ns($string)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return array{string, string}
+ */
+ public function split_ns(string $string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> static $cache = [];
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($cache[$string])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -374,7 +400,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $cache[$string];
</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">- private function parse_hcard($data, $category = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, mixed> $data
+ */
+ private function parse_hcard(array $data, bool $category = false): string
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $name = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $link = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -398,8 +427,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $data['value'] ?? '';
</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">- private function parse_microformats(&$data, $url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return true
+ */
+ private function parse_microformats(string &$data, string $url): bool
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // For PHPStan, we already check that in call site.
+ \assert(function_exists('Mf2\parse'));
+ \assert(function_exists('Mf2\fetch'));
</ins><span class="cx" style="display: block; padding: 0 10px"> $feed_title = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $feed_author = null;
</span><span class="cx" style="display: block; padding: 0 10px"> $author_cache = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,23 +520,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author_cache[$author])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $author = $author_cache[$author];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $mf = \Mf2\fetch($author);
- foreach ($mf['items'] as $hcard) {
- // Only interested in an h-card by itself in this case.
- if (!in_array('h-card', $hcard['type'])) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($mf = \Mf2\fetch($author)) {
+ foreach ($mf['items'] as $hcard) {
+ // Only interested in an h-card by itself in this case.
+ if (!in_array('h-card', $hcard['type'])) {
+ continue;
+ }
+ // It must have a url property matching what we fetched.
+ if (!isset($hcard['properties']['url']) ||
+ !(in_array($author, $hcard['properties']['url']))) {
+ continue;
+ }
+ // Save parse_hcard the trouble of finding the correct url.
+ $hcard['properties']['url'][0] = $author;
+ // Cache this h-card for the next h-entry to check.
+ $author_cache[$author] = $this->parse_hcard($hcard);
+ $author = $author_cache[$author];
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // It must have a url property matching what we fetched.
- if (!isset($hcard['properties']['url']) ||
- !(in_array($author, $hcard['properties']['url']))) {
- continue;
- }
- // Save parse_hcard the trouble of finding the correct url.
- $hcard['properties']['url'][0] = $author;
- // Cache this h-card for the next h-entry to check.
- $author_cache[$author] = $this->parse_hcard($hcard);
- $author = $author_cache[$author];
- break;
</del><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">@@ -619,11 +655,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- private function declare_html_entities()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private static function set_doctype(string $data): string
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Strip DOCTYPE except if containing an [internal subset]
+ $data = preg_replace('/^\\s*<!DOCTYPE\\s[^>\\[\\]]*>\s*/', '', $data) ?? $data;
+ // Declare HTML entities only if no remaining DOCTYPE
+ $doctype = preg_match('/^\\s*<!DOCTYPE\\s/', $data) ? '' : self::declare_html_entities();
+ return $doctype . $data;
+ }
+
+ private static function declare_html_entities(): string
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> // This is required because the RSS specification says that entity-encoded
</span><span class="cx" style="display: block; padding: 0 10px"> // html is allowed, but the xml specification says they must be declared.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return '<!DOCTYPE html [ <!ENTITY nbsp " "> <!ENTITY iexcl "¡"> <!ENTITY cent "¢"> <!ENTITY pound "£"> <!ENTITY curren "¤"> <!ENTITY yen "¥"> <!ENTITY brvbar "¦"> <!ENTITY sect "§"> <!ENTITY uml "¨"> <!ENTITY copy "©"> <!ENTITY ordf "ª"> <!ENTITY laquo "«"> <!ENTITY not "¬"> <!ENTITY shy "­"> <!ENTITY reg "®"> <!ENTITY macr "¯"> <!ENTITY deg "°"> <!ENTITY plusmn "±"> <!ENTITY sup2 "
2;"> <!ENTITY sup3 "³"> <!ENTITY acute "´"> <!ENTITY micro "µ"> <!ENTITY para "¶"> <!ENTITY middot "·"> <!ENTITY cedil "¸"> <!ENTITY sup1 "¹"> <!ENTITY ordm "º"> <!ENTITY raquo "»"> <!ENTITY frac14 "¼"> <!ENTITY frac12 "½"> <!ENTITY frac34 "¾"> <!ENTITY iquest "¿"> <!ENTITY Agrave "À"> <!ENTITY Aacute "Á"> <!ENTITY Acirc "Â"> <!ENTITY Atilde "Ã"> <!ENTITY Auml "Ä"> <!ENTITY Aring "Å"> <!ENTITY AElig "Æ"> <!ENTITY Ccedil "Ç&quo
t;> <!ENTITY Egrave "È"> <!ENTITY Eacute "É"> <!ENTITY Ecirc "Ê"> <!ENTITY Euml "Ë"> <!ENTITY Igrave "Ì"> <!ENTITY Iacute "Í"> <!ENTITY Icirc "Î"> <!ENTITY Iuml "Ï"> <!ENTITY ETH "Ð"> <!ENTITY Ntilde "Ñ"> <!ENTITY Ograve "Ò"> <!ENTITY Oacute "Ó"> <!ENTITY Ocirc "Ô"> <!ENTITY Otilde "Õ"> <!ENTITY Ouml "Ö"> <!ENTITY times "×"> <!ENTITY Oslash "Ø"> <!ENTITY Ugrave "Ù"> <!ENTITY Uacute "Ú"> <!ENTITY Ucirc "Û"> <!ENTITY Uuml "Ü">
; <!ENTITY Yacute "Ý"> <!ENTITY THORN "Þ"> <!ENTITY szlig "ß"> <!ENTITY agrave "à"> <!ENTITY aacute "á"> <!ENTITY acirc "â"> <!ENTITY atilde "ã"> <!ENTITY auml "ä"> <!ENTITY aring "å"> <!ENTITY aelig "æ"> <!ENTITY ccedil "ç"> <!ENTITY egrave "è"> <!ENTITY eacute "é"> <!ENTITY ecirc "ê"> <!ENTITY euml "ë"> <!ENTITY igrave "ì"> <!ENTITY iacute "í"> <!ENTITY icirc "î"> <!ENTITY iuml "ï"> <!ENTITY eth "ð"> <!ENTITY ntilde "ñ"> <
;!ENTITY ograve "ò"> <!ENTITY oacute "ó"> <!ENTITY ocirc "ô"> <!ENTITY otilde "õ"> <!ENTITY ouml "ö"> <!ENTITY divide "÷"> <!ENTITY oslash "ø"> <!ENTITY ugrave "ù"> <!ENTITY uacute "ú"> <!ENTITY ucirc "û"> <!ENTITY uuml "ü"> <!ENTITY yacute "ý"> <!ENTITY thorn "þ"> <!ENTITY yuml "ÿ"> <!ENTITY OElig "Œ"> <!ENTITY oelig "œ"> <!ENTITY Scaron "Š"> <!ENTITY scaron "š"> <!ENTITY Yuml "Ÿ"> <!ENTITY fnof "ƒ"> <!ENTITY circ "ˆ"> <!ENTI
TY tilde "˜"> <!ENTITY Alpha "Α"> <!ENTITY Beta "Β"> <!ENTITY Gamma "Γ"> <!ENTITY Epsilon "Ε"> <!ENTITY Zeta "Ζ"> <!ENTITY Eta "Η"> <!ENTITY Theta "Θ"> <!ENTITY Iota "Ι"> <!ENTITY Kappa "Κ"> <!ENTITY Lambda "Λ"> <!ENTITY Mu "Μ"> <!ENTITY Nu "Ν"> <!ENTITY Xi "Ξ"> <!ENTITY Omicron "Ο"> <!ENTITY Pi "Π"> <!ENTITY Rho "Ρ"> <!ENTITY Sigma "Σ"> <!ENTITY Tau "Τ"> <!ENTITY Upsilon "Υ"> <!ENTITY Phi "Φ"> <!ENTITY Chi "Χ&
quot;> <!ENTITY Psi "Ψ"> <!ENTITY Omega "Ω"> <!ENTITY alpha "α"> <!ENTITY beta "β"> <!ENTITY gamma "γ"> <!ENTITY delta "δ"> <!ENTITY epsilon "ε"> <!ENTITY zeta "ζ"> <!ENTITY eta "η"> <!ENTITY theta "θ"> <!ENTITY iota "ι"> <!ENTITY kappa "κ"> <!ENTITY lambda "λ"> <!ENTITY mu "μ"> <!ENTITY nu "ν"> <!ENTITY xi "ξ"> <!ENTITY omicron "ο"> <!ENTITY pi "π"> <!ENTITY rho "ρ"> <!ENTITY sigmaf "ς"> <!ENTITY sigma "σ"> <!ENTITY tau
"τ"> <!ENTITY upsilon "υ"> <!ENTITY phi "φ"> <!ENTITY chi "χ"> <!ENTITY psi "ψ"> <!ENTITY omega "ω"> <!ENTITY thetasym "ϑ"> <!ENTITY upsih "ϒ"> <!ENTITY piv "ϖ"> <!ENTITY ensp " "> <!ENTITY emsp " "> <!ENTITY thinsp " "> <!ENTITY zwnj "‌"> <!ENTITY zwj "‍"> <!ENTITY lrm "‎"> <!ENTITY rlm "‏"> <!ENTITY ndash "–"> <!ENTITY mdash "—"> <!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY sbquo "‚"> <!ENTITY ldquo "“&q
uot;> <!ENTITY rdquo "”"> <!ENTITY bdquo "„"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡"> <!ENTITY bull "•"> <!ENTITY hellip "…"> <!ENTITY permil "‰"> <!ENTITY prime "′"> <!ENTITY Prime "″"> <!ENTITY lsaquo "‹"> <!ENTITY rsaquo "›"> <!ENTITY oline "‾"> <!ENTITY frasl "⁄"> <!ENTITY euro "€"> <!ENTITY image "ℑ"> <!ENTITY weierp "℘"> <!ENTITY real "ℜ"> <!ENTITY trade "™"> <!ENTITY alefsym "ℵ"> <!ENTITY larr "←"> <!ENTITY uarr "↑"&g
t; <!ENTITY rarr "→"> <!ENTITY darr "↓"> <!ENTITY harr "↔"> <!ENTITY crarr "↵"> <!ENTITY lArr "⇐"> <!ENTITY uArr "⇑"> <!ENTITY rArr "⇒"> <!ENTITY dArr "⇓"> <!ENTITY hArr "⇔"> <!ENTITY forall "∀"> <!ENTITY part "∂"> <!ENTITY exist "∃"> <!ENTITY empty "∅"> <!ENTITY nabla "∇"> <!ENTITY isin "∈"> <!ENTITY notin "∉"> <!ENTITY ni "∋"> <!ENTITY prod "∏"> <!ENTITY sum "∑"> <!ENTITY minus "−"> <!ENTITY lowast "∗"> <!ENTITY radic &qu
ot;√"> <!ENTITY prop "∝"> <!ENTITY infin "∞"> <!ENTITY ang "∠"> <!ENTITY and "∧"> <!ENTITY or "∨"> <!ENTITY cap "∩"> <!ENTITY cup "∪"> <!ENTITY int "∫"> <!ENTITY there4 "∴"> <!ENTITY sim "∼"> <!ENTITY cong "≅"> <!ENTITY asymp "≈"> <!ENTITY ne "≠"> <!ENTITY equiv "≡"> <!ENTITY le "≤"> <!ENTITY ge "≥"> <!ENTITY sub "⊂"> <!ENTITY sup "⊃"> <!ENTITY nsub "⊄"> <!ENTITY sube "⊆"> <!ENTITY supe "⊇"> <!ENTITY oplu
s "⊕"> <!ENTITY otimes "⊗"> <!ENTITY perp "⊥"> <!ENTITY sdot "⋅"> <!ENTITY lceil "⌈"> <!ENTITY rceil "⌉"> <!ENTITY lfloor "⌊"> <!ENTITY rfloor "⌋"> <!ENTITY lang "〈"> <!ENTITY rang "〉"> <!ENTITY loz "◊"> <!ENTITY spades "♠"> <!ENTITY clubs "♣"> <!ENTITY hearts "♥"> <!ENTITY diams "♦"> ]>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return '<!DOCTYPE rss [ <!ENTITY nbsp " "> <!ENTITY iexcl "¡"> <!ENTITY cent "¢"> <!ENTITY pound "£"> <!ENTITY curren "¤"> <!ENTITY yen "¥"> <!ENTITY brvbar "¦"> <!ENTITY sect "§"> <!ENTITY uml "¨"> <!ENTITY copy "©"> <!ENTITY ordf "ª"> <!ENTITY laquo "«"> <!ENTITY not "¬"> <!ENTITY shy "­"> <!ENTITY reg "®"> <!ENTITY macr "¯"> <!ENTITY deg "°"> <!ENTITY plusmn "±"> <!ENTITY sup2 "²
"> <!ENTITY sup3 "³"> <!ENTITY acute "´"> <!ENTITY micro "µ"> <!ENTITY para "¶"> <!ENTITY middot "·"> <!ENTITY cedil "¸"> <!ENTITY sup1 "¹"> <!ENTITY ordm "º"> <!ENTITY raquo "»"> <!ENTITY frac14 "¼"> <!ENTITY frac12 "½"> <!ENTITY frac34 "¾"> <!ENTITY iquest "¿"> <!ENTITY Agrave "À"> <!ENTITY Aacute "Á"> <!ENTITY Acirc "Â"> <!ENTITY Atilde "Ã"> <!ENTITY Auml "Ä"> <!ENTITY Aring "Å"> <!ENTITY AElig "Æ"> <!ENTITY Ccedil "Ç"
> <!ENTITY Egrave "È"> <!ENTITY Eacute "É"> <!ENTITY Ecirc "Ê"> <!ENTITY Euml "Ë"> <!ENTITY Igrave "Ì"> <!ENTITY Iacute "Í"> <!ENTITY Icirc "Î"> <!ENTITY Iuml "Ï"> <!ENTITY ETH "Ð"> <!ENTITY Ntilde "Ñ"> <!ENTITY Ograve "Ò"> <!ENTITY Oacute "Ó"> <!ENTITY Ocirc "Ô"> <!ENTITY Otilde "Õ"> <!ENTITY Ouml "Ö"> <!ENTITY times "×"> <!ENTITY Oslash "Ø"> <!ENTITY Ugrave "Ù"> <!ENTITY Uacute "Ú"> <!ENTITY Ucirc "Û"> <!ENTITY Uuml "Ü">
<!ENTITY Yacute "Ý"> <!ENTITY THORN "Þ"> <!ENTITY szlig "ß"> <!ENTITY agrave "à"> <!ENTITY aacute "á"> <!ENTITY acirc "â"> <!ENTITY atilde "ã"> <!ENTITY auml "ä"> <!ENTITY aring "å"> <!ENTITY aelig "æ"> <!ENTITY ccedil "ç"> <!ENTITY egrave "è"> <!ENTITY eacute "é"> <!ENTITY ecirc "ê"> <!ENTITY euml "ë"> <!ENTITY igrave "ì"> <!ENTITY iacute "í"> <!ENTITY icirc "î"> <!ENTITY iuml "ï"> <!ENTITY eth "ð"> <!ENTITY ntilde "ñ"> <!
ENTITY ograve "ò"> <!ENTITY oacute "ó"> <!ENTITY ocirc "ô"> <!ENTITY otilde "õ"> <!ENTITY ouml "ö"> <!ENTITY divide "÷"> <!ENTITY oslash "ø"> <!ENTITY ugrave "ù"> <!ENTITY uacute "ú"> <!ENTITY ucirc "û"> <!ENTITY uuml "ü"> <!ENTITY yacute "ý"> <!ENTITY thorn "þ"> <!ENTITY yuml "ÿ"> <!ENTITY OElig "Œ"> <!ENTITY oelig "œ"> <!ENTITY Scaron "Š"> <!ENTITY scaron "š"> <!ENTITY Yuml "Ÿ"> <!ENTITY fnof "ƒ"> <!ENTITY circ "ˆ"> <!ENTITY
tilde "˜"> <!ENTITY Alpha "Α"> <!ENTITY Beta "Β"> <!ENTITY Gamma "Γ"> <!ENTITY Epsilon "Ε"> <!ENTITY Zeta "Ζ"> <!ENTITY Eta "Η"> <!ENTITY Theta "Θ"> <!ENTITY Iota "Ι"> <!ENTITY Kappa "Κ"> <!ENTITY Lambda "Λ"> <!ENTITY Mu "Μ"> <!ENTITY Nu "Ν"> <!ENTITY Xi "Ξ"> <!ENTITY Omicron "Ο"> <!ENTITY Pi "Π"> <!ENTITY Rho "Ρ"> <!ENTITY Sigma "Σ"> <!ENTITY Tau "Τ"> <!ENTITY Upsilon "Υ"> <!ENTITY Phi "Φ"> <!ENTITY Chi "Χ&qu
ot;> <!ENTITY Psi "Ψ"> <!ENTITY Omega "Ω"> <!ENTITY alpha "α"> <!ENTITY beta "β"> <!ENTITY gamma "γ"> <!ENTITY delta "δ"> <!ENTITY epsilon "ε"> <!ENTITY zeta "ζ"> <!ENTITY eta "η"> <!ENTITY theta "θ"> <!ENTITY iota "ι"> <!ENTITY kappa "κ"> <!ENTITY lambda "λ"> <!ENTITY mu "μ"> <!ENTITY nu "ν"> <!ENTITY xi "ξ"> <!ENTITY omicron "ο"> <!ENTITY pi "π"> <!ENTITY rho "ρ"> <!ENTITY sigmaf "ς"> <!ENTITY sigma "σ"> <!ENTITY tau &
quot;τ"> <!ENTITY upsilon "υ"> <!ENTITY phi "φ"> <!ENTITY chi "χ"> <!ENTITY psi "ψ"> <!ENTITY omega "ω"> <!ENTITY thetasym "ϑ"> <!ENTITY upsih "ϒ"> <!ENTITY piv "ϖ"> <!ENTITY ensp " "> <!ENTITY emsp " "> <!ENTITY thinsp " "> <!ENTITY zwnj "‌"> <!ENTITY zwj "‍"> <!ENTITY lrm "‎"> <!ENTITY rlm "‏"> <!ENTITY ndash "–"> <!ENTITY mdash "—"> <!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY sbquo "‚"> <!ENTITY ldquo "“&quo
t;> <!ENTITY rdquo "”"> <!ENTITY bdquo "„"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡"> <!ENTITY bull "•"> <!ENTITY hellip "…"> <!ENTITY permil "‰"> <!ENTITY prime "′"> <!ENTITY Prime "″"> <!ENTITY lsaquo "‹"> <!ENTITY rsaquo "›"> <!ENTITY oline "‾"> <!ENTITY frasl "⁄"> <!ENTITY euro "€"> <!ENTITY image "ℑ"> <!ENTITY weierp "℘"> <!ENTITY real "ℜ"> <!ENTITY trade "™"> <!ENTITY alefsym "ℵ"> <!ENTITY larr "←"> <!ENTITY uarr "↑">
<!ENTITY rarr "→"> <!ENTITY darr "↓"> <!ENTITY harr "↔"> <!ENTITY crarr "↵"> <!ENTITY lArr "⇐"> <!ENTITY uArr "⇑"> <!ENTITY rArr "⇒"> <!ENTITY dArr "⇓"> <!ENTITY hArr "⇔"> <!ENTITY forall "∀"> <!ENTITY part "∂"> <!ENTITY exist "∃"> <!ENTITY empty "∅"> <!ENTITY nabla "∇"> <!ENTITY isin "∈"> <!ENTITY notin "∉"> <!ENTITY ni "∋"> <!ENTITY prod "∏"> <!ENTITY sum "∑"> <!ENTITY minus "−"> <!ENTITY lowast "∗"> <!ENTITY radic "
;√"> <!ENTITY prop "∝"> <!ENTITY infin "∞"> <!ENTITY ang "∠"> <!ENTITY and "∧"> <!ENTITY or "∨"> <!ENTITY cap "∩"> <!ENTITY cup "∪"> <!ENTITY int "∫"> <!ENTITY there4 "∴"> <!ENTITY sim "∼"> <!ENTITY cong "≅"> <!ENTITY asymp "≈"> <!ENTITY ne "≠"> <!ENTITY equiv "≡"> <!ENTITY le "≤"> <!ENTITY ge "≥"> <!ENTITY sub "⊂"> <!ENTITY sup "⊃"> <!ENTITY nsub "⊄"> <!ENTITY sube "⊆"> <!ENTITY supe "⊇"> <!ENTITY oplus
"⊕"> <!ENTITY otimes "⊗"> <!ENTITY perp "⊥"> <!ENTITY sdot "⋅"> <!ENTITY lceil "⌈"> <!ENTITY rceil "⌉"> <!ENTITY lfloor "⌊"> <!ENTITY rfloor "⌋"> <!ENTITY lang "〈"> <!ENTITY rang "〉"> <!ENTITY loz "◊"> <!ENTITY spades "♠"> <!ENTITY clubs "♣"> <!ENTITY hearts "♥"> <!ENTITY diams "♦"> ]>';
</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></pre></div>
<a id="trunksrcwpincludesSimplePiesrcRatingphp"></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/src/Rating.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Rating.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Rating.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,9 +13,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Enclosure::get_rating()} and {@see \SimplePie\Enclosure::get_ratings()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_rating_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Rating
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Rating 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">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_scheme()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $scheme;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Rating value
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_value()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $value;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,8 +38,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($scheme = null, $value = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(
+ ?string $scheme = null,
+ ?string $value = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->scheme = $scheme;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->value = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcRegistryphp"></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/src/Registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Registry.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Registry.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,49 +1,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use InvalidArgumentException;
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Content\Type\Sniffer;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Parse\Date;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\XML\Declaration\Parser as DeclarationParser;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Handles creating objects and calling methods
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Access this via {@see \SimplePie\SimplePie::get_registry()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Registry
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Class mapping
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see register()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, class-string>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected $classes = [];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $legacy Whether to enable legacy support for this class
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Successfulness
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function register($type, $class, $legacy = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function register(string $type, $class, bool $legacy = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (array_key_exists($type, $this->legacyTypes)) {
</span><span class="cx" style="display: block; padding: 0 10px"> // trigger_error(sprintf('"%s"(): Using argument #1 ($type) with value "%s" is deprecated since SimplePie 1.8.0, use class-string "%s" instead.', __METHOD__, $type, $this->legacyTypes[$type]), \E_USER_DEPRECATED);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,9 +162,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">+ // For PHPStan: values in $default should be subtypes of keys.
+ /** @var class-string<T> */
</ins><span class="cx" style="display: block; padding: 0 10px"> $class = $this->default[$type];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (array_key_exists($type, $this->classes)) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // For PHPStan: values in $classes should be subtypes of keys.
+ /** @var class-string<T> */
</ins><span class="cx" style="display: block; padding: 0 10px"> $class = $this->classes[$type];
</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">@@ -214,17 +180,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @template T class-string $type
</span><span class="cx" style="display: block; padding: 0 10px"> * @param class-string<T> $type
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $parameters Parameters to pass to the constructor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $parameters Parameters to pass to the constructor
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return T Instance of class
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function &create($type, $parameters = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function &create($type, array $parameters = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $class = $this->get_class($type);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($class === null) {
+ throw new InvalidArgumentException(sprintf(
+ '%s(): Argument #1 ($type) "%s" not found in class list.',
+ __METHOD__,
+ $type
+ ), 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (!method_exists($class, '__construct')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = new $class();
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $reflector = new \ReflectionClass($class);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // For PHPStan: $class is T.
+ /** @var T */
</ins><span class="cx" style="display: block; padding: 0 10px"> $instance = $reflector->newInstanceArgs($parameters);
</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">@@ -234,6 +209,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error(sprintf('Using the method "set_registry()" without implementing "%s" is deprecated since SimplePie 1.8.0, implement "%s" in "%s".', RegistryAware::class, RegistryAware::class, $class), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px"> $instance->set_registry($this);
</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"> return $instance;
</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">@@ -242,12 +218,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param class-string $type
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $method
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $parameters
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $parameters
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function &call($type, $method, $parameters = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function &call($type, string $method, array $parameters = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $class = $this->get_class($type);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($class === null) {
+ throw new InvalidArgumentException(sprintf(
+ '%s(): Argument #1 ($type) "%s" not found in class list.',
+ __METHOD__,
+ $type
+ ), 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (in_array($class, $this->legacy)) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ($type) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,6 +239,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Cache::create() methods in PHP < 8.0.
</span><span class="cx" style="display: block; padding: 0 10px"> // No longer supported as of PHP 8.0.
</span><span class="cx" style="display: block; padding: 0 10px"> if ($method === 'get_handler') {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fixing this PHPStan error breaks CacheTest::testDirectOverrideLegacy()
+ /** @phpstan-ignore argument.type */
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = @call_user_func_array([$class, 'create'], $parameters);
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -263,7 +248,9 @@
</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">- $result = call_user_func_array([$class, $method], $parameters);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $callable = [$class, $method];
+ assert(is_callable($callable), 'For PHPstan');
+ $result = call_user_func_array($callable, $parameters);
</ins><span class="cx" style="display: block; padding: 0 10px"> return $result;
</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="trunksrcwpincludesSimplePiesrcRegistryAwarephp"></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/src/RegistryAware.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/RegistryAware.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/RegistryAware.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2022 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -48,8 +11,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Handles the injection of Registry into other class
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * {@see \SimplePie\SimplePie::get_registry()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> interface RegistryAware
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,9 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the Registry into the class
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param Registry $registry
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_registry(Registry $registry)/* : void */;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_registry(Registry $registry);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcRestrictionphp"></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/src/Restriction.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Restriction.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Restriction.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,16 +13,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Restriction
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public const RELATIONSHIP_ALLOW = 'allow';
+ public const RELATIONSHIP_DENY = 'deny';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Relationship ('allow'/'deny')
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var self::RELATIONSHIP_*|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_relationship()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $relationship;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Type of restriction
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_type()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Restricted values
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see get_value()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $value;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,8 +48,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * For documentation on all the parameters, see the corresponding
</span><span class="cx" style="display: block; padding: 0 10px"> * properties and their accessors
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @param ?self::RELATIONSHIP_* $relationship
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($relationship = null, $type = null, $value = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(?string $relationship = null, ?string $type = null, ?string $value = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->relationship = $relationship;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->type = $type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the relationship
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null Either 'allow' or 'deny'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return ?self::RELATIONSHIP_*
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_relationship()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcSanitizephp"></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/src/Sanitize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Sanitize.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Sanitize.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,55 +1,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use DOMDocument;
+use DOMXPath;
</ins><span class="cx" style="display: block; padding: 0 10px"> use InvalidArgumentException;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\UriFactoryInterface;
</ins><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Base;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\BaseDataCache;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\CallableNameFilter;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\DataCache;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\NameFilter;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use SimplePie\HTTP\Client;
+use SimplePie\HTTP\ClientException;
+use SimplePie\HTTP\FileClient;
+use SimplePie\HTTP\Psr18Client;
</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"> * Used for data cleanup and post-processing
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,26 +29,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie\SimplePie::set_sanitize_class()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package SimplePie
</del><span class="cx" style="display: block; padding: 0 10px"> * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Sanitize implements RegistryAware
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Private vars
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $base;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
+ public $base = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Options
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $remove_div = true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $image_handler = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $encode_instead_of_strip = false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $strip_attributes = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string[] */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $rename_attributes = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<string, array<string, string>> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $strip_comments = false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $output_encoding = 'UTF-8';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $enable_cache = true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $cache_location = './cache';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string&(callable(string): string) */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $cache_name_function = 'md5';
</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">@@ -83,10 +67,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @var NameFilter
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private $cache_namefilter;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var int */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $timeout = 10;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $useragent = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var bool */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $force_fsockopen = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $replace_url_attributes = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<string, string|string[]> */
+ public $replace_url_attributes = [];
+ /**
+ * @var array<int, mixed> Custom curl options
+ * @see SimplePie::set_curl_options()
+ */
+ private $curl_options = [];
+
+ /** @var Registry */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $registry;
</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">@@ -104,9 +99,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see \SimplePie\Sanitize::set_https_domains()
</span><span class="cx" style="display: block; padding: 0 10px"> * Array is a tree split at DNS levels. Example:
</span><span class="cx" style="display: block; padding: 0 10px"> * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true)))
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var true|array<string, true|array<string, true|array<string, array<string, true|array<string, true|array<string, true>>>>>>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $https_domains = [];
</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 Client|null
+ */
+ private $http_client = null;
+
</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">@@ -113,36 +114,50 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_url_replacements(null);
</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">- public function remove_div($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function remove_div(bool $enable = true)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->remove_div = (bool) $enable;
</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">+ /**
+ * @param string|false $page
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function set_image_handler($page = false)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($page) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->image_handler = (string) $page;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->image_handler = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->image_handler = '';
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_registry(\SimplePie\Registry $registry)/* : void */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function set_registry(\SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry = $registry;
</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">- public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', ?DataCache $cache = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param (string&(callable(string): string))|NameFilter $cache_name_function
+ * @param class-string<Cache> $cache_class
+ * @return void
+ */
+ public function pass_cache_data(bool $enable_cache = true, string $cache_location = './cache', $cache_name_function = 'md5', string $cache_class = Cache::class, ?DataCache $cache = null)
</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 (isset($enable_cache)) {
- $this->enable_cache = (bool) $enable_cache;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->enable_cache = $enable_cache;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ($cache_location) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->cache_location = (string) $cache_location;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->cache_location = $cache_location;
</ins><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 (!is_string($cache_name_function) && !is_object($cache_name_function) && !$cache_name_function instanceof NameFilter) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // @phpstan-ignore-next-line Enforce PHPDoc type.
+ if (!is_string($cache_name_function) && !$cache_name_function instanceof NameFilter) {
</ins><span class="cx" style="display: block; padding: 0 10px"> throw new InvalidArgumentException(sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '%s(): Argument #3 ($cache_name_function) must be of type %s',
</span><span class="cx" style="display: block; padding: 0 10px"> __METHOD__,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // BC: $cache_name_function could be a callable as string
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_string($cache_name_function)) {
</span><span class="cx" style="display: block; padding: 0 10px"> // trigger_error(sprintf('Providing $cache_name_function as string in "%s()" is deprecated since SimplePie 1.8.0, provide as "%s" instead.', __METHOD__, NameFilter::class), \E_USER_DEPRECATED);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->cache_name_function = (string) $cache_name_function;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->cache_name_function = $cache_name_function;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_name_function = new CallableNameFilter($cache_name_function);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,21 +180,49 @@
</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">- public function pass_file_data($file_class = 'SimplePie\File', $timeout = 10, $useragent = '', $force_fsockopen = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Set a PSR-18 client and PSR-17 factories
+ *
+ * Allows you to use your own HTTP client implementations.
+ */
+ final public function set_http_client(
+ ClientInterface $http_client,
+ RequestFactoryInterface $request_factory,
+ UriFactoryInterface $uri_factory
+ ): void {
+ $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory);
+ }
+
+ /**
+ * @deprecated since SimplePie 1.9.0, use \SimplePie\Sanitize::set_http_client() instead.
+ * @param class-string<File> $file_class
+ * @param array<int, mixed> $curl_options
+ * @return void
+ */
+ public function pass_file_data(string $file_class = File::class, int $timeout = 10, string $useragent = '', bool $force_fsockopen = false, array $curl_options = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('SimplePie\Sanitize::pass_file_data() is deprecated since SimplePie 1.9.0, please use "SimplePie\Sanitize::set_http_client()" instead.'), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($timeout) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->timeout = (string) $timeout;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->timeout = $timeout;
</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"> if ($useragent) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->useragent = (string) $useragent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->useragent = $useragent;
</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"> if ($force_fsockopen) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->force_fsockopen = (string) $force_fsockopen;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->force_fsockopen = $force_fsockopen;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $this->curl_options = $curl_options;
+ // Invalidate the registered client.
+ $this->http_client = null;
</ins><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">+ /**
+ * @param string[]|string|false $tags Set a list of tags to strip, or set empty string to use default tags, or false to strip nothing.
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'])
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($tags) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,15 +232,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->strip_htmltags = explode(',', $tags);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->strip_htmltags = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->strip_htmltags = [];
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function encode_instead_of_strip($encode = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function encode_instead_of_strip(bool $encode = false)
</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->encode_instead_of_strip = (bool) $encode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->encode_instead_of_strip = $encode;
</ins><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">+ /**
+ * @param string[]|string $attribs
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rename_attributes($attribs = [])
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($attribs) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,10 +257,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->rename_attributes = explode(',', $attribs);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->rename_attributes = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->rename_attributes = [];
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string[]|string $attribs
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function strip_attributes($attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'])
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($attribs) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,31 +274,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->strip_attributes = explode(',', $attribs);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->strip_attributes = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->strip_attributes = [];
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function add_attributes($attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, array<string, string>> $attribs
+ * @return void
+ */
+ public function add_attributes(array $attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']])
</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 ($attribs) {
- if (is_array($attribs)) {
- $this->add_attributes = $attribs;
- } else {
- $this->add_attributes = explode(',', $attribs);
- }
- } else {
- $this->add_attributes = false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->add_attributes = $attribs;
</ins><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">- public function strip_comments($strip = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function strip_comments(bool $strip = false)
</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->strip_comments = (bool) $strip;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->strip_comments = $strip;
</ins><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">- public function set_output_encoding($encoding = 'UTF-8')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function set_output_encoding(string $encoding = 'UTF-8')
</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->output_encoding = (string) $encoding;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->output_encoding = $encoding;
</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">@@ -256,9 +312,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * |ins|@cite, |q|@cite, |source|@src, |video|@src
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|null $element_attribute Element/attribute key/value pairs, null for default
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, string|string[]>|null $element_attribute Element/attribute key/value pairs, null for default
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_url_replacements($element_attribute = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_url_replacements(?array $element_attribute = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($element_attribute === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $element_attribute = [
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,7 +339,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"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->replace_url_attributes = (array) $element_attribute;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->replace_url_attributes = $element_attribute;
</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">@@ -289,13 +346,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the list of domains for which to force HTTPS.
</span><span class="cx" style="display: block; padding: 0 10px"> * @see \SimplePie\Misc::https_url()
</span><span class="cx" style="display: block; padding: 0 10px"> * Example array('biz', 'example.com', 'example.org', 'www.example.net');
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @param string[] $domains list of domain names ['biz', 'example.com', 'example.org', 'www.example.net']
+ *
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_https_domains($domains)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_https_domains(array $domains)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->https_domains = [];
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($domains as $domain) {
</span><span class="cx" style="display: block; padding: 0 10px"> $domain = trim($domain, ". \t\n\r\0\x0B");
</span><span class="cx" style="display: block; padding: 0 10px"> $segments = array_reverse(explode('.', $domain));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var true|array<string, true|array<string, true|array<string, array<string, true|array<string, true|array<string, true>>>>>> */ // Needed for PHPStan.
</ins><span class="cx" style="display: block; padding: 0 10px"> $node = &$this->https_domains;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($segments as $segment) {//Build a tree
</span><span class="cx" style="display: block; padding: 0 10px"> if ($node === true) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,8 +374,10 @@
</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"> * Check if the domain is in the list of forced HTTPS.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function is_https_domain($domain)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function is_https_domain(string $domain)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $domain = trim($domain, '. ');
</span><span class="cx" style="display: block; padding: 0 10px"> $segments = array_reverse(explode('.', $domain));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,16 +394,26 @@
</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"> * Force HTTPS for selected Web sites.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function https_url($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function https_url(string $url)
</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 (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;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (
+ strtolower(substr($url, 0, 7)) === 'http://'
+ && ($parsed = parse_url($url, PHP_URL_HOST)) !== false // Malformed URL
+ && $parsed !== null // Missing host
+ && $this->is_https_domain($parsed) // Should be forced?
+ ) ? substr_replace($url, 's', 4, 0) // Add the 's' to HTTPS
+ : $url;
</ins><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">- public function sanitize($data, $type, $base = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
+ * @param string $base
+ * @return string Sanitized data; false if output encoding is changed to something other than UTF-8 and conversion fails
+ */
+ public function sanitize(string $data, int $type, string $base = '')
</ins><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="cx" style="display: block; padding: 0 10px"> if ($data !== '' || $type & \SimplePie\SimplePie::CONSTRUCT_IRI) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,9 +436,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $document = new \DOMDocument();
</span><span class="cx" style="display: block; padding: 0 10px"> $document->encoding = 'UTF-8';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // PHPStan seems to have trouble resolving int-mask because bitwise
+ // operators are used when operators are used when passing this parameter.
+ // https://github.com/phpstan/phpstan/issues/9384
+ /** @var int-mask-of<SimplePie::CONSTRUCT_*> $type */
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $this->preprocess($data, $type);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_error_handler(['SimplePie\Misc', 'silence_errors']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_error_handler([Misc::class, 'silence_errors']);
</ins><span class="cx" style="display: block; padding: 0 10px"> $document->loadHTML($data);
</span><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="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,16 +450,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Strip comments
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->strip_comments) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var \DOMNodeList<\DOMComment> */
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $xpath->query('//comment()');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($comments as $comment) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comment->parentNode->removeChild($comment);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parentNode = $comment->parentNode;
+ assert($parentNode !== null, 'For PHPStan, comment must have a parent');
+ $parentNode->removeChild($comment);
</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="cx" style="display: block; padding: 0 10px"> // Strip out HTML tags and attributes that might cause various security problems.
</span><span class="cx" style="display: block; padding: 0 10px"> // Based on recommendations by Mark Pilgrim at:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // https://web.archive.org/web/20110902041826/http://diveintomark.org:80/archives/2003/06/12/how_to_consume_rss_safely
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->strip_htmltags) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($this->strip_htmltags as $tag) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->strip_tag($tag, $document, $xpath, $type);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -413,7 +494,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"> // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->image_handler !== '' && $this->enable_cache) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $images = $document->getElementsByTagName('img');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($images as $img) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -424,11 +505,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($cache->get_data($image_url, false)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $img->setAttribute('src', $this->image_handler . $image_url);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file = $this->registry->create(File::class, [$img->getAttribute('src'), $this->timeout, 5, ['X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']], $this->useragent, $this->force_fsockopen]);
- $headers = $file->headers;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ try {
+ $file = $this->get_http_client()->request(
+ Client::METHOD_GET,
+ $img->getAttribute('src'),
+ ['X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']]
+ );
+ } catch (ClientException $th) {
+ continue;
+ }
</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 ($file->success && ($file->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) {
- if ($cache->set_data($image_url, ['headers' => $file->headers, 'body' => $file->body], $this->cache_duration)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ((!Misc::is_remote_uri($file->get_final_requested_uri()) || ($file->get_status_code() === 200 || $file->get_status_code() > 206 && $file->get_status_code() < 300))) {
+ if ($cache->set_data($image_url, ['headers' => $file->get_headers(), 'body' => $file->get_body_content()], $this->cache_duration)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $img->setAttribute('src', $this->image_handler . $image_url);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,18 +528,23 @@
</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"> // Get content node
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $div = $document->getElementsByTagName('body')->item(0)->firstChild;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $div = null;
+ if (($item = $document->getElementsByTagName('body')->item(0)) !== null) {
+ $div = $item->firstChild;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> // Finally, convert to a HTML string
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = trim($document->saveHTML($div));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = trim((string) $document->saveHTML($div));
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->remove_div) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = preg_replace('/^<div' . \SimplePie\SimplePie::PCRE_XML_ATTRIBUTE . '>/', '', $data);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = preg_replace('/<\/div>$/', '', $data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan, it is unable to validate a non-literal regex above.
+ $data = preg_replace('/<\/div>$/', '', (string) $data);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = preg_replace('/^<div' . \SimplePie\SimplePie::PCRE_XML_ATTRIBUTE . '>/', '<div>', $data);
</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">- $data = str_replace('</source>', '', $data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cast for PHPStan, it is unable to validate a non-literal regex above.
+ $data = str_replace('</source>', '', (string) $data);
</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"> if ($type & \SimplePie\SimplePie::CONSTRUCT_IRI) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,6 +559,8 @@
</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"> if ($this->output_encoding !== 'UTF-8') {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations.
+ /** @var string */
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $this->registry->call(Misc::class, 'change_encoding', [$data, 'UTF-8', $this->output_encoding]);
</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">@@ -472,7 +567,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $data;
</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">- protected function preprocess($html, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
+ * @return string
+ */
+ protected function preprocess(string $html, int $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,7 +592,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $ret;
</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">- public function replace_urls($document, $tag, $attributes)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string>|string $attributes
+ * @return void
+ */
+ public function replace_urls(DOMDocument $document, string $tag, $attributes)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_array($attributes)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attributes = [$attributes];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -515,7 +618,11 @@
</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">- public function do_strip_htmltags($match)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<int, string> $match
+ * @return string
+ */
+ public function do_strip_htmltags(array $match)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->encode_instead_of_strip) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($match[4]) && !in_array(strtolower($match[1]), ['script', 'style'])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,9 +639,21 @@
</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">- protected function strip_tag($tag, $document, $xpath, $type)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
+ * @return void
+ */
+ protected function strip_tag(string $tag, DOMDocument $document, DOMXPath $xpath, int $type)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = $xpath->query('body//' . $tag);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ($elements === false) {
+ throw new \SimplePie\Exception(sprintf(
+ '%s(): Possibly malformed expression, check argument #1 ($tag)',
+ __METHOD__
+ ), 1);
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->encode_instead_of_strip) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><span class="cx" style="display: block; padding: 0 10px"> $fragment = $document->createDocumentFragment();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -542,7 +661,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // For elements which aren't script or style, include the tag itself
</span><span class="cx" style="display: block; padding: 0 10px"> if (!in_array($tag, ['script', 'style'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $text = '<' . $tag;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($element->hasAttributes()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($element->attributes !== null) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $attrs = [];
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($element->attributes as $name => $attr) {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $attr->value;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -568,8 +687,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $number = $element->childNodes->length;
</span><span class="cx" style="display: block; padding: 0 10px"> for ($i = $number; $i > 0; $i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $child = $element->childNodes->item(0);
- $fragment->appendChild($child);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($child = $element->childNodes->item(0)) !== null) {
+ $fragment->appendChild($child);
+ }
</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"> if (!in_array($tag, ['script', 'style'])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,13 +696,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fragment->appendChild(new \DOMText('</' . $tag . '>'));
</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">- $element->parentNode->replaceChild($fragment, $element);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($parentNode = $element->parentNode) !== null) {
+ $parentNode->replaceChild($fragment, $element);
+ }
</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"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (in_array($tag, ['script', 'style'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $element->parentNode->removeChild($element);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($parentNode = $element->parentNode) !== null) {
+ $parentNode->removeChild($element);
+ }
</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"> return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -591,28 +715,53 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fragment = $document->createDocumentFragment();
</span><span class="cx" style="display: block; padding: 0 10px"> $number = $element->childNodes->length;
</span><span class="cx" style="display: block; padding: 0 10px"> for ($i = $number; $i > 0; $i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $child = $element->childNodes->item(0);
- $fragment->appendChild($child);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($child = $element->childNodes->item(0)) !== null) {
+ $fragment->appendChild($child);
+ }
</ins><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">- $element->parentNode->replaceChild($fragment, $element);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($parentNode = $element->parentNode) !== null) {
+ $parentNode->replaceChild($fragment, $element);
+ }
</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="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function strip_attr($attrib, $xpath)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ protected function strip_attr(string $attrib, DOMXPath $xpath)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = $xpath->query('//*[@' . $attrib . ']');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($elements === false) {
+ throw new \SimplePie\Exception(sprintf(
+ '%s(): Possibly malformed expression, check argument #1 ($attrib)',
+ __METHOD__
+ ), 1);
+ }
+
+ /** @var \DOMElement $element */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><span class="cx" style="display: block; padding: 0 10px"> $element->removeAttribute($attrib);
</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">- protected function rename_attr($attrib, $xpath)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ protected function rename_attr(string $attrib, DOMXPath $xpath)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = $xpath->query('//*[@' . $attrib . ']');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($elements === false) {
+ throw new \SimplePie\Exception(sprintf(
+ '%s(): Possibly malformed expression, check argument #1 ($attrib)',
+ __METHOD__
+ ), 1);
+ }
+
+ /** @var \DOMElement $element */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><span class="cx" style="display: block; padding: 0 10px"> $element->setAttribute('data-sanitized-' . $attrib, $element->getAttribute($attrib));
</span><span class="cx" style="display: block; padding: 0 10px"> $element->removeAttribute($attrib);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -619,9 +768,14 @@
</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">- protected function add_attr($tag, $valuePairs, $document)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, string> $valuePairs
+ * @return void
+ */
+ protected function add_attr(string $tag, array $valuePairs, DOMDocument $document)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = $document->getElementsByTagName($tag);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var \DOMElement $element */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($elements as $element) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($valuePairs as $attrib => $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> $element->setAttribute($attrib, $value);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -636,7 +790,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return DataCache
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function get_cache($image_url = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function get_cache(string $image_url = ''): DataCache
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->cache === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Not providing as PSR-16 cache implementation is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()".'), \E_USER_DEPRECATED);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -651,6 +805,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->cache;
</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 a HTTP client
+ */
+ private function get_http_client(): Client
+ {
+ if ($this->http_client === null) {
+ $this->http_client = new FileClient(
+ $this->registry,
+ [
+ 'timeout' => $this->timeout,
+ 'redirects' => 5,
+ 'useragent' => $this->useragent,
+ 'force_fsockopen' => $this->force_fsockopen,
+ 'curl_options' => $this->curl_options,
+ ]
+ );
+ }
+
+ return $this->http_client;
+ }
</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"> class_alias('SimplePie\Sanitize', 'SimplePie_Sanitize');
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcSimplePiephp"></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/src/SimplePie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/SimplePie.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/SimplePie.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,50 +1,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> use InvalidArgumentException;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\UriFactoryInterface;
</ins><span class="cx" style="display: block; padding: 0 10px"> use Psr\SimpleCache\CacheInterface;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Base;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\BaseDataCache;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,12 +19,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\NameFilter;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Cache\Psr16;
</span><span class="cx" style="display: block; padding: 0 10px"> use SimplePie\Content\Type\Sniffer;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use SimplePie\Exception as SimplePieException;
+use SimplePie\HTTP\Client;
+use SimplePie\HTTP\ClientException;
+use SimplePie\HTTP\FileClient;
+use SimplePie\HTTP\Psr18Client;
+use SimplePie\HTTP\Response;
</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"> * SimplePie
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SimplePie
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * SimplePie Version
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public const VERSION = '1.8.1';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public const VERSION = '1.9.0';
</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"> * SimplePie Website URL
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,16 +380,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public const FILE_SOURCE_FILE_GET_CONTENTS = 16;
</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">- * @var array Raw data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @internal Default value of the HTTP Accept header when fetching/locating feeds
+ */
+ public const DEFAULT_HTTP_ACCEPT_HEADER = 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1';
+
+ /**
+ * @var array<string, mixed> Raw data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $data = [];
</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">- * @var mixed Error string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|string[]|null Error string (or array when multiple feeds are initialized)
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $error;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public $error = null;
</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"> * @var int HTTP status code
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -430,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $status_code = 0;
</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">- * @var object Instance of \SimplePie\Sanitize (or other class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var Sanitize instance of Sanitize class
</ins><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="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,7 +425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $feed_url;
</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">- * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var ?string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::subscribe_url()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,14 +432,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $permanent_url = null;
</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">- * @var object Instance of \SimplePie\File to use as a feed
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var File Instance of File class to use as a feed
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_file()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @access private
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public $file;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private $file;
</ins><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">- * @var string Raw feed data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string|false Raw feed data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_raw_data()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,7 +452,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $timeout = 10;
</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">- * @var array Custom curl options
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<int, mixed> Custom curl options
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_curl_options()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -550,7 +523,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $cache_location = './cache';
</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">- * @var string Function that creates the cache filename
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string&(callable(string): string) Function that creates the cache filename
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_cache_name_function()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,7 +545,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $input_encoding = false;
</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">- * @var int Feed Autodiscovery Level
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var self::LOCATOR_* Feed Autodiscovery Level
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_autodiscovery_level()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -581,7 +554,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Class registry object
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @var \SimplePie\Registry
</del><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><span class="cx" style="display: block; padding: 0 10px"> public $registry;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -593,7 +566,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $max_checked_feeds = 10;
</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">- * @var array All the feeds found during the autodiscovery process
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<Response>|null All the feeds found during the autodiscovery process
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::get_all_discovered_feeds()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -607,7 +580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $image_handler = '';
</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">- * @var array Stores the URLs when multiple feeds are being initialized.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string> Stores the URLs when multiple feeds are being initialized.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_feed_url()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,13 +587,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $multifeed_url = [];
</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">- * @var array Stores SimplePie objects when multiple feeds initialized.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<int, static> Stores SimplePie objects when multiple feeds initialized.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $multifeed_objects = [];
</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">- * @var array Stores the get_object_vars() array for use with multifeeds.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<mixed> Stores the get_object_vars() array for use with multifeeds.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_feed_url()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -627,7 +600,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $config_settings = null;
</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">- * @var integer Stores the number of items to return per-feed with multifeeds.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var int Stores the number of items to return per-feed with multifeeds.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::set_item_limit()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -640,7 +613,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $check_modified = false;
</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">- * @var array Stores the default attributes to be stripped by strip_attributes().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string> Stores the default attributes to be stripped by strip_attributes().
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::strip_attributes()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,7 +620,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $strip_attributes = ['bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'];
</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">- * @var array Stores the default attributes to add to different tags by add_attributes().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string, array<string, string>> Stores the default attributes to add to different tags by add_attributes().
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::add_attributes()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -654,7 +627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']];
</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">- * @var array Stores the default tags to be stripped by strip_htmltags().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var array<string> Stores the default tags to be stripped by strip_htmltags().
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::strip_htmltags()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -661,7 +634,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'];
</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">- * @var array Stores the default attributes to be renamed by rename_attributes().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @var string[]|string Stores the default attributes to be renamed by rename_attributes().
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see SimplePie::rename_attributes()
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -674,6 +647,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $enable_exceptions = false;
</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 Client|null
+ */
+ private $http_client = null;
+
+ /** @var bool Whether HTTP client has been injected */
+ private $http_client_injected = false;
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * The SimplePie class contains feed level data and options
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * To use SimplePie, create the SimplePie object with no parameters. You can
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -698,8 +679,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_cache_namefilter(new CallableNameFilter($this->cache_name_function));
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Other objects, instances created here so we can set options on them
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->sanitize = new \SimplePie\Sanitize();
- $this->registry = new \SimplePie\Registry();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->sanitize = new Sanitize();
+ $this->registry = new Registry();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (func_num_args() > 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', \E_USER_DEPRECATED);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,6 +702,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"> * Used for converting object to a string
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __toString()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -729,6 +711,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"> * Remove items that link back to this before destroying this object
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __destruct()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -756,10 +739,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $enable Force the given data/URL to be treated as a feed
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function force_feed($enable = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function force_feed(bool $enable = false)
</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->force_feed = (bool) $enable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->force_feed = $enable;
</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">@@ -769,18 +753,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * website you want to try to use auto-discovery on. This takes priority
</span><span class="cx" style="display: block; padding: 0 10px"> * over any set raw data.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * You can set multiple feeds to mash together by passing an array instead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Deprecated since 1.9.0: You can set multiple feeds to mash together by passing an array instead
</ins><span class="cx" style="display: block; padding: 0 10px"> * of a string for the $url. Remember that with each additional feed comes
</span><span class="cx" style="display: block; padding: 0 10px"> * additional processing and resources.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Preview Release
</span><span class="cx" style="display: block; padding: 0 10px"> * @see set_raw_data()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $url This is the URL (or array of URLs) that you want to parse.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|string[] $url This is the URL (or (deprecated) array of URLs) that you want to parse.
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_feed_url($url)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->multifeed_url = [];
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_array($url)) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error('Fetching multiple feeds with single SimplePie instance is deprecated since SimplePie 1.9.0, create one SimplePie instance per feed and use SimplePie::merge_items to get a single list of items.', \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ($url as $value) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->multifeed_url[] = $this->registry->call(Misc::class, 'fix_protocol', [$value, 1]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -791,20 +777,22 @@
</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">- * Set an instance of {@see \SimplePie\File} to use as a feed
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Set an instance of {@see File} to use as a feed
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param \SimplePie\File &$file
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated since SimplePie 1.9.0, use \SimplePie\SimplePie::set_http_client() or \SimplePie\SimplePie::set_raw_data() instead.
+ *
+ * @param File &$file
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_file(&$file)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_file(File &$file)
</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 ($file instanceof \SimplePie\File) {
- $this->feed_url = $file->url;
- $this->permanent_url = $this->feed_url;
- $this->file = &$file;
- return true;
- }
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // trigger_error(sprintf('SimplePie\SimplePie::set_file() is deprecated since SimplePie 1.9.0, please use "SimplePie\SimplePie::set_http_client()" or "SimplePie\SimplePie::set_raw_data()" instead.'), \E_USER_DEPRECATED);
+
+ $this->feed_url = $file->get_final_requested_uri();
+ $this->permanent_url = $this->feed_url;
+ $this->file = &$file;
+
+ return true;
</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">@@ -819,13 +807,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Beta 3
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data RSS or Atom data as a string.
</span><span class="cx" style="display: block; padding: 0 10px"> * @see set_feed_url()
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_raw_data($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_raw_data(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->raw_data = $data;
</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 a PSR-18 client and PSR-17 factories
+ *
+ * Allows you to use your own HTTP client implementations.
+ * This will become required with SimplePie 2.0.0.
+ */
+ final public function set_http_client(
+ ClientInterface $http_client,
+ RequestFactoryInterface $request_factory,
+ UriFactoryInterface $uri_factory
+ ): void {
+ $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory);
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Set the default timeout for fetching remote feeds
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This allows you to change the maximum time the feed's server to respond
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -833,10 +836,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Beta 3
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_timeout($timeout = 10)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_timeout(int $timeout = 10)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->http_client_injected) {
+ throw new SimplePieException(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure timeout in your HTTP client instead.',
+ __METHOD__,
+ self::class
+ ));
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->timeout = (int) $timeout;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Reset a possible existing FileClient,
+ // so a new client with the changed value will be created
+ if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
+ $this->http_client = null;
+ } elseif (is_object($this->http_client)) {
+ // Trigger notice if a PSR-18 client was set
+ trigger_error(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the timeout in your HTTP client instead.',
+ __METHOD__,
+ get_class($this)
+ ), \E_USER_NOTICE);
+ }
</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">@@ -845,11 +870,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * This allows you to change default curl options
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Beta 3
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $curl_options Curl options to add to default settings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<int, mixed> $curl_options Curl options to add to default settings
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_curl_options(array $curl_options = [])
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->http_client_injected) {
+ throw new SimplePieException(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure custom curl options in your HTTP client instead.',
+ __METHOD__,
+ self::class
+ ));
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->curl_options = $curl_options;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Reset a possible existing FileClient,
+ // so a new client with the changed value will be created
+ if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
+ $this->http_client = null;
+ } elseif (is_object($this->http_client)) {
+ // Trigger notice if a PSR-18 client was set
+ trigger_error(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the curl options in your HTTP client instead.',
+ __METHOD__,
+ get_class($this)
+ ), \E_USER_NOTICE);
+ }
</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">@@ -857,10 +904,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Beta 3
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $enable Force fsockopen() to be used
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function force_fsockopen($enable = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function force_fsockopen(bool $enable = false)
</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->force_fsockopen = (bool) $enable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->http_client_injected) {
+ throw new SimplePieException(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.',
+ __METHOD__,
+ self::class
+ ));
+ }
+
+ $this->force_fsockopen = $enable;
+
+ // Reset a possible existing FileClient,
+ // so a new client with the changed value will be created
+ if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
+ $this->http_client = null;
+ } elseif (is_object($this->http_client)) {
+ // Trigger notice if a PSR-18 client was set
+ trigger_error(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.',
+ __METHOD__,
+ get_class($this)
+ ), \E_USER_NOTICE);
+ }
</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">@@ -871,16 +940,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0 Preview Release
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $enable Enable caching
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function enable_cache($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function enable_cache(bool $enable = true)
</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->enable_cache = (bool) $enable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->enable_cache = $enable;
</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="cx" style="display: block; padding: 0 10px"> * Set a PSR-16 implementation as cache
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param CacheInterface $psr16cache The PSR-16 cache implementation
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param CacheInterface $cache The PSR-16 cache implementation
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -900,11 +970,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, expired cache will not be used anymore.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $enable Force use of cache on fail.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function force_cache_fallback($enable = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function force_cache_fallback(bool $enable = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('SimplePie\SimplePie::force_cache_fallback() is deprecated since SimplePie 1.8.0, expired cache will not be used anymore.'), \E_USER_DEPRECATED);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->force_cache_fallback = (bool) $enable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->force_cache_fallback = $enable;
</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">@@ -912,10 +983,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * cached
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $seconds The feed content cache duration
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_cache_duration($seconds = 3600)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_cache_duration(int $seconds = 3600)
</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->cache_duration = (int) $seconds;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->cache_duration = $seconds;
</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">@@ -923,23 +995,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * be cached
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $seconds The autodiscovered feed URL cache duration.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_autodiscovery_cache_duration($seconds = 604800)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_autodiscovery_cache_duration(int $seconds = 604800)
</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->autodiscovery_cache_duration = (int) $seconds;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->autodiscovery_cache_duration = $seconds;
</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="cx" style="display: block; padding: 0 10px"> * Set the file system location where the cached files should be stored
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @deprecated since SimplePie 1.8.0, use \SimplePie\SimplePie::set_cache() instead.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated since SimplePie 1.8.0, use SimplePie::set_cache() instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $location The file system location.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_cache_location($location = './cache')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_cache_location(string $location = './cache')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('SimplePie\SimplePie::set_cache_location() is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()" instead.'), \E_USER_DEPRECATED);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->cache_location = (string) $location;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->cache_location = $location;
</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">@@ -948,7 +1022,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The URL of the feed to be cached.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string A filename (i.e. hash, without path and without extension).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_cache_filename($url)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_cache_filename(string $url)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> $url .= $this->force_feed ? '#force_feed' : '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,7 +1030,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->timeout != 10) {
</span><span class="cx" style="display: block; padding: 0 10px"> $options[CURLOPT_TIMEOUT] = $this->timeout;
</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 ($this->useragent !== \SimplePie\Misc::get_default_useragent()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->useragent !== Misc::get_default_useragent()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $options[CURLOPT_USERAGENT] = $this->useragent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($this->curl_options)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -976,10 +1050,11 @@
</span><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function enable_order_by_date($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function enable_order_by_date(bool $enable = true)
</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->order_by_date = (bool) $enable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->order_by_date = $enable;
</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">@@ -988,7 +1063,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * This overrides the encoding reported by the feed, however it will fall
</span><span class="cx" style="display: block; padding: 0 10px"> * back to the normal encoding detection if the override fails
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $encoding Character encoding
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|false $encoding Character encoding
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_input_encoding($encoding = false)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1002,18 +1078,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set how much feed autodiscovery to do
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see \SimplePie\SimplePie::LOCATOR_NONE
- * @see \SimplePie\SimplePie::LOCATOR_AUTODISCOVERY
- * @see \SimplePie\SimplePie::LOCATOR_LOCAL_EXTENSION
- * @see \SimplePie\SimplePie::LOCATOR_LOCAL_BODY
- * @see \SimplePie\SimplePie::LOCATOR_REMOTE_EXTENSION
- * @see \SimplePie\SimplePie::LOCATOR_REMOTE_BODY
- * @see \SimplePie\SimplePie::LOCATOR_ALL
- * @param int $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see self::LOCATOR_NONE
+ * @see self::LOCATOR_AUTODISCOVERY
+ * @see self::LOCATOR_LOCAL_EXTENSION
+ * @see self::LOCATOR_LOCAL_BODY
+ * @see self::LOCATOR_REMOTE_EXTENSION
+ * @see self::LOCATOR_REMOTE_BODY
+ * @see self::LOCATOR_ALL
+ * @param self::LOCATOR_* $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_autodiscovery_level($level = self::LOCATOR_ALL)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_autodiscovery_level(int $level = self::LOCATOR_ALL)
</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->autodiscovery = (int) $level;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->autodiscovery = $level;
</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">@@ -1020,7 +1097,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the class registry
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Use this to override SimplePie's default classes
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see \SimplePie\Registry
</del><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return Registry
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1034,13 +1110,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see set_cache()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Cache> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_cache_class($class = Cache::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_cache_class(string $class = Cache::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::set_cache()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::set_cache()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Cache::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1050,13 +1126,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Locator> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_locator_class($class = Locator::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_locator_class(string $class = Locator::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Locator::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1066,13 +1142,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Parser> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_parser_class($class = Parser::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_parser_class(string $class = Parser::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Parser::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1082,13 +1158,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<File> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_file_class($class = File::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_file_class(string $class = File::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(File::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1098,13 +1174,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Sanitize> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_sanitize_class($class = Sanitize::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_sanitize_class(string $class = Sanitize::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Sanitize::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1114,13 +1190,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Item> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_item_class($class = Item::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_item_class(string $class = Item::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Item::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1130,13 +1206,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Author> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_author_class($class = Author::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_author_class(string $class = Author::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Author::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1146,13 +1222,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Category> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_category_class($class = Category::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_category_class(string $class = Category::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Category::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1162,13 +1238,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Enclosure> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_enclosure_class($class = Enclosure::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_enclosure_class(string $class = Enclosure::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Enclosure::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1178,13 +1254,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Caption> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_caption_class($class = Caption::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_caption_class(string $class = Caption::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Caption::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1194,13 +1270,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Copyright> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_copyright_class($class = Copyright::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_copyright_class(string $class = Copyright::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Copyright::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,13 +1286,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Credit> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_credit_class($class = Credit::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_credit_class(string $class = Credit::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Credit::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1226,13 +1302,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Rating> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_rating_class($class = Rating::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_rating_class(string $class = Rating::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Rating::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1242,13 +1318,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Restriction> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_restriction_class($class = Restriction::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_restriction_class(string $class = Restriction::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Restriction::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1258,13 +1334,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Sniffer> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_content_type_sniffer_class($class = Sniffer::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_content_type_sniffer_class(string $class = Sniffer::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Sniffer::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1274,13 +1350,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.3, use {@see get_registry()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $class Name of custom class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param class-string<Source> $class Name of custom class
</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 boolean True on success, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True on success, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_source_class($class = Source::class)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_source_class(string $class = Source::class)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->registry->register(Source::class, $class, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1289,14 +1365,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the user agent string
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $ua New user agent string.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_useragent($ua = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_useragent(?string $ua = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->http_client_injected) {
+ throw new SimplePieException(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure user agent string in your HTTP client instead.',
+ __METHOD__,
+ self::class
+ ));
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($ua === null) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $ua = \SimplePie\Misc::get_default_useragent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $ua = Misc::get_default_useragent();
</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"> $this->useragent = (string) $ua;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Reset a possible existing FileClient,
+ // so a new client with the changed value will be created
+ if (is_object($this->http_client) && $this->http_client instanceof FileClient) {
+ $this->http_client = null;
+ } elseif (is_object($this->http_client)) {
+ // Trigger notice if a PSR-18 client was set
+ trigger_error(sprintf(
+ 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the useragent in your HTTP client instead.',
+ __METHOD__,
+ get_class($this)
+ ), \E_USER_NOTICE);
+ }
</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">@@ -1316,17 +1414,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated since SimplePie 1.8.0, use {@see set_cache_namefilter()} instead
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $function Callback function
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param (string&(callable(string): string))|null $function Callback function
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_cache_name_function($function = 'md5')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_cache_name_function(?string $function = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache_namefilter()" instead.', __METHOD__), \E_USER_DEPRECATED);
</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 (is_callable($function)) {
- $this->cache_name_function = $function;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($function === null) {
+ $function = 'md5';
+ }
</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->set_cache_namefilter(new CallableNameFilter($this->cache_name_function));
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->cache_name_function = $function;
+
+ $this->set_cache_namefilter(new CallableNameFilter($this->cache_name_function));
</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">@@ -1336,16 +1437,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * turns SimplePie into a dumb parser of feeds.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $set Whether to set them or not
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_stupidly_fast($set = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_stupidly_fast(bool $set = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($set) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->enable_order_by_date(false);
</span><span class="cx" style="display: block; padding: 0 10px"> $this->remove_div(false);
</span><span class="cx" style="display: block; padding: 0 10px"> $this->strip_comments(false);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->strip_htmltags(false);
- $this->strip_attributes(false);
- $this->add_attributes(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->strip_htmltags([]);
+ $this->strip_attributes([]);
+ $this->add_attributes([]);
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->set_image_handler(false);
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_https_domains([]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1355,18 +1457,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set maximum number of feeds to check with autodiscovery
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $max Maximum number of feeds to check
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_max_checked_feeds($max = 10)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_max_checked_feeds(int $max = 10)
</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->max_checked_feeds = (int) $max;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->max_checked_feeds = $max;
</ins><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">- public function remove_div($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function remove_div(bool $enable = true)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->remove_div($enable);
</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">- public function strip_htmltags($tags = '', $encode = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string[]|string|false $tags Set a list of tags to strip, or set empty string to use default tags, or false to strip nothing.
+ * @return void
+ */
+ public function strip_htmltags($tags = '', ?bool $encode = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($tags === '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = $this->strip_htmltags;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1377,11 +1487,18 @@
</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">- public function encode_instead_of_strip($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function encode_instead_of_strip(bool $enable = true)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->encode_instead_of_strip($enable);
</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">+ /**
+ * @param string[]|string $attribs
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rename_attributes($attribs = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($attribs === '') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1390,6 +1507,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->rename_attributes($attribs);
</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">+ /**
+ * @param string[]|string $attribs
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function strip_attributes($attribs = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($attribs === '') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1398,6 +1519,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->strip_attributes($attribs);
</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">+ /**
+ * @param array<string, array<string, string>>|'' $attribs
+ * @return void
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function add_attributes($attribs = '')
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($attribs === '') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1427,13 +1552,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * more information.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $encoding
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_output_encoding($encoding = 'UTF-8')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_output_encoding(string $encoding = 'UTF-8')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->set_output_encoding($encoding);
</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">- public function strip_comments($strip = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function strip_comments(bool $strip = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->strip_comments($strip);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1447,9 +1576,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * |q|@cite
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|null $element_attribute Element/attribute key/value pairs, null for default
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, string|string[]>|null $element_attribute Element/attribute key/value pairs, null for default
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_url_replacements($element_attribute = null)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_url_replacements(?array $element_attribute = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->set_url_replacements($element_attribute);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1456,23 +1586,23 @@
</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"> * Set the list of domains for which to force HTTPS.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see \SimplePie\Sanitize::set_https_domains()
- * @param array List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net').
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see Sanitize::set_https_domains()
+ * @param array<string> $domains List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net').
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_https_domains($domains = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_https_domains(array $domains = [])
</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 (is_array($domains)) {
- $this->sanitize->set_https_domains($domains);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->sanitize->set_https_domains($domains);
</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="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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page Web-accessible path to the handler_image.php file.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|false $page Web-accessible path to the handler_image.php file.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $qs The query string that the value should be passed to.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_image_handler($page = false, $qs = 'i')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_image_handler($page = false, string $qs = 'i')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($page !== false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->set_image_handler($page . '?' . $qs . '=');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1484,19 +1614,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the limit for items returned per-feed with multifeeds
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param integer $limit The maximum number of items to return.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $limit The maximum number of items to return.
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_item_limit($limit = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_item_limit(int $limit = 0)
</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->item_limit = (int) $limit;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->item_limit = $limit;
</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="cx" style="display: block; padding: 0 10px"> * Enable throwing exceptions
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param boolean $enable Should we throw exceptions, or use the old-style error property?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $enable Should we throw exceptions, or use the old-style error property?
+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function enable_exceptions($enable = true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function enable_exceptions(bool $enable = true)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->enable_exceptions = $enable;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1508,7 +1640,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * configuration options get processed, feeds are fetched, cached, and
</span><span class="cx" style="display: block; padding: 0 10px"> * parsed, and all of that other good stuff.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return boolean True if successful, false otherwise
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True if successful, false otherwise
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function init()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1523,7 +1655,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($xml_is_sane === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parser_check = xml_parser_create();
</span><span class="cx" style="display: block; padding: 0 10px"> xml_parse_into_struct($parser_check, '<foo>&</foo>', $values);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xml_parser_free($parser_check);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (\PHP_VERSION_ID < 80000) {
+ xml_parser_free($parser_check);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $xml_is_sane = isset($values[0]['value']);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!$xml_is_sane) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1533,7 +1667,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The default sanitize class gets set in the constructor, check if it has
</span><span class="cx" style="display: block; padding: 0 10px"> // changed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($this->registry->get_class(Sanitize::class) !== 'SimplePie\Sanitize') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->registry->get_class(Sanitize::class) !== Sanitize::class) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize = $this->registry->create(Sanitize::class);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (method_exists($this->sanitize, 'set_registry')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1542,15 +1676,26 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass whatever was set with config options over to the sanitizer.
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass the classes in for legacy support; new classes should use the registry instead
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cache = $this->registry->get_class(Cache::class);
+ \assert($cache !== null, 'Cache must be defined');
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->sanitize->pass_cache_data(
</span><span class="cx" style="display: block; padding: 0 10px"> $this->enable_cache,
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache_location,
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache_namefilter,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->registry->get_class(Cache::class),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cache,
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->sanitize->pass_file_data($this->registry->get_class(File::class), $this->timeout, $this->useragent, $this->force_fsockopen, $this->curl_options);
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $http_client = $this->get_http_client();
+
+ if ($http_client instanceof Psr18Client) {
+ $this->sanitize->set_http_client(
+ $http_client->getHttpClient(),
+ $http_client->getRequestFactory(),
+ $http_client->getUriFactory()
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!empty($this->multifeed_url)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> $success = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1585,7 +1730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = $this->get_cache($this->feed_url);
</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">- // Fetch the data via \SimplePie\File into $this->raw_data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fetch the data into $this->raw_data
</ins><span class="cx" style="display: block; padding: 0 10px"> if (($fetched = $this->fetch_data($cache)) === true) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ($fetched === false) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1649,7 +1794,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = $this->registry->create(Parser::class);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If it's parsed fine
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url ?? '')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->data = $parser->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> if (!($this->get_type() & ~self::TYPE_NONE)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->error = "A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed.";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1660,10 +1805,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($headers)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['headers'] = $headers;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['build'] = \SimplePie\Misc::get_build();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['build'] = Misc::get_build();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cache the file if caching is enabled
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['cache_expiration_time'] = $this->cache_duration + time();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($cache && !$cache->set_data($this->get_cache_filename($this->feed_url), $this->data, $this->cache_duration)) {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1673,7 +1819,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"> if (isset($parser)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // We have an error, just set \SimplePie\Misc::error to it and quit
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // We have an error, just set Misc::error to it and quit
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->error = $this->feed_url;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->error .= sprintf(' is invalid XML, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1701,19 +1847,21 @@
</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">- * Fetch the data via \SimplePie\File
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Fetch the data
</ins><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param Base|DataCache|false $cache Cache handler, or false to not load from the cache
</span><del style="background-color: #fdd; text-decoration:none; 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
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array{array<string, string>, string}|bool Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type
</ins><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="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (is_object($cache) && $cache instanceof Base) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($cache instanceof Base) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Providing $cache as "\SimplePie\Cache\Base" in %s() is deprecated since SimplePie 1.8.0, please provide "\SimplePie\Cache\DataCache" implementation instead.', __METHOD__), \E_USER_DEPRECATED);
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = new BaseDataCache($cache);
</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">+ // @phpstan-ignore-next-line Enforce PHPDoc type.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($cache !== false && !$cache instanceof DataCache) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new InvalidArgumentException(sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '%s(): Argument #1 ($cache) must be of type %s|false',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1731,7 +1879,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($this->data)) {
</span><span class="cx" style="display: block; padding: 0 10px"> // If the cache is for an outdated build of SimplePie
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!isset($this->data['build']) || $this->data['build'] !== \SimplePie\Misc::get_build()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isset($this->data['build']) || $this->data['build'] !== Misc::get_build()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $cache->delete_data($cacheKey);
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = [];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1763,7 +1911,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_modified = true;
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER,
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->data['headers']['last-modified'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $headers['if-modified-since'] = $this->data['headers']['last-modified'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1772,26 +1920,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers['if-none-match'] = $this->data['headers']['etag'];
</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">- $file = $this->registry->create(File::class, [$this->feed_url, $this->timeout / 10, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options]);
- $this->status_code = $file->status_code;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ try {
+ $file = $this->get_http_client()->request(Client::METHOD_GET, $this->feed_url, $headers);
+ $this->status_code = $file->get_status_code();
+ } catch (ClientException $th) {
+ $this->check_modified = false;
+ $this->status_code = 0;
</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 ($file->success) {
- if ($file->status_code === 304) {
- // Set raw_data to false here too, to signify that the cache
- // is still valid.
- $this->raw_data = false;
- $cache->set_data($cacheKey, $this->data, $this->cache_duration);
- return true;
- }
- } else {
- $this->check_modified = false;
</del><span class="cx" style="display: block; padding: 0 10px"> if ($this->force_cache_fallback) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['cache_expiration_time'] = $this->cache_duration + time();
</ins><span class="cx" style="display: block; padding: 0 10px"> $cache->set_data($cacheKey, $this->data, $this->cache_duration);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- unset($file);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $failedFileReason = $th->getMessage();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ($this->status_code === 304) {
+ // Set raw_data to false here too, to signify that the cache
+ // is still valid.
+ $this->raw_data = false;
+ $this->data['cache_expiration_time'] = $this->cache_duration + time();
+ $cache->set_data($cacheKey, $this->data, $this->cache_duration);
+
+ return true;
+ }
</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"> // If the cache is still valid, just return true
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1808,40 +1962,72 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($file)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($this->file instanceof \SimplePie\File && $this->file->url === $this->feed_url) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->file instanceof File && $this->file->get_final_requested_uri() === $this->feed_url) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $file = &$this->file;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif (isset($failedFileReason)) {
+ // Do not try to fetch again if we already failed once.
+ // If the file connection had an error, set SimplePie::error to that and quit
+ $this->error = $failedFileReason;
+
+ return !empty($this->data);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER,
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file = $this->registry->create(File::class, [$this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ try {
+ $file = $this->get_http_client()->request(Client::METHOD_GET, $this->feed_url, $headers);
+ } catch (ClientException $th) {
+ // If the file connection has an error, set SimplePie::error to that and quit
+ $this->error = $th->getMessage();
+
+ return !empty($this->data);
+ }
</ins><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">- $this->status_code = $file->status_code;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->status_code = $file->get_status_code();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If the file connection has an error, set SimplePie::error to that and quit
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!$file->success && !($file->method & self::FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) {
- $this->error = $file->error;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!(!Misc::is_remote_uri($file->get_final_requested_uri()) || ($file->get_status_code() === 200 || $file->get_status_code() > 206 && $file->get_status_code() < 300))) {
+ $this->error = 'Retrieved unsupported status code "' . $this->status_code . '"';
</ins><span class="cx" style="display: block; padding: 0 10px"> return !empty($this->data);
</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"> if (!$this->force_feed) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if the supplied URL is a feed, if it isn't, look for it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $locate = $this->registry->create(Locator::class, [&$file, $this->timeout, $this->useragent, $this->max_checked_feeds, $this->force_fsockopen, $this->curl_options]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locate = $this->registry->create(Locator::class, [
+ (!$file instanceof File) ? File::fromResponse($file) : $file,
+ $this->timeout,
+ $this->useragent,
+ $this->max_checked_feeds,
+ $this->force_fsockopen,
+ $this->curl_options
+ ]);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $http_client = $this->get_http_client();
+
+ if ($http_client instanceof Psr18Client) {
+ $locate->set_http_client(
+ $http_client->getHttpClient(),
+ $http_client->getRequestFactory(),
+ $http_client->getUriFactory()
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!$locate->is_feed($file)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $copyStatusCode = $file->status_code;
- $copyContentType = $file->headers['content-type'] ?? '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $copyStatusCode = $file->get_status_code();
+ $copyContentType = $file->get_header_line('content-type');
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> $microformats = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $doc = new \DOMDocument();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- @$doc->loadHTML($file->body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ @$doc->loadHTML($file->get_body_content());
</ins><span class="cx" style="display: block; padding: 0 10px"> $xpath = new \DOMXpath($doc);
</span><span class="cx" style="display: block; padding: 0 10px"> // Check for both h-feed and h-entry, as both a feed with no entries
</span><span class="cx" style="display: block; padding: 0 10px"> // and a list of entries without an h-feed wrapper are both valid.
</span><span class="cx" style="display: block; padding: 0 10px"> $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
</span><span class="cx" style="display: block; padding: 0 10px"> 'contains(concat(" ", @class, " "), " h-entry ")]';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /** @var \DOMNodeList<\DOMElement> $result */
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $xpath->query($query);
</span><span class="cx" style="display: block; padding: 0 10px"> $microformats = $result->length !== 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1852,13 +2038,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->all_discovered_feeds
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> if ($microformats) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($hub = $locate->get_rel_link('hub')) {
- $self = $locate->get_rel_link('self');
- $this->store_links($file, $hub, $self);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $hub = $locate->get_rel_link('hub');
+ $self = $locate->get_rel_link('self');
+ if ($hub || $self) {
+ $file = $this->store_links($file, $hub, $self);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Push the current file onto all_discovered feeds so the user can
</span><span class="cx" style="display: block; padding: 0 10px"> // be shown this as one of the options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (isset($this->all_discovered_feeds)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($this->all_discovered_feeds !== null) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->all_discovered_feeds[] = $file;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1873,7 +2060,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- } catch (\SimplePie\Exception $e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } catch (SimplePieException $e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // We need to unset this so that if SimplePie::set_file() has been called that object is untouched
</span><span class="cx" style="display: block; padding: 0 10px"> unset($file);
</span><span class="cx" style="display: block; padding: 0 10px"> // This is usually because DOMDocument doesn't exist
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1885,8 +2072,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($cache) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = [
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => $this->feed_url,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'feed_url' => $file->url,
- 'build' => \SimplePie\Misc::get_build(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'feed_url' => $file->get_final_requested_uri(),
+ 'build' => Misc::get_build(),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'cache_expiration_time' => $this->cache_duration + time(),
</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">@@ -1895,13 +2082,18 @@
</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">- $this->feed_url = $file->url;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->feed_url = $file->get_final_requested_uri();
</ins><span class="cx" style="display: block; padding: 0 10px"> $locate = null;
</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">- $this->raw_data = $file->body;
- $this->permanent_url = $file->permanent_url;
- $headers = $file->headers;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->raw_data = $file->get_body_content();
+ $this->permanent_url = $file->get_permanent_uri();
+
+ $headers = [];
+ foreach ($file->get_headers() as $key => $values) {
+ $headers[$key] = implode(', ', $values);
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $sniffer = $this->registry->create(Sniffer::class, [&$file]);
</span><span class="cx" style="display: block; padding: 0 10px"> $sniffed = $sniffer->get_type();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1911,7 +2103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the error message for the occurred error
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|array Error message, or array of messages for multifeeds
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|string[]|null Error message, or array of messages for multifeeds
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function error()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1934,7 +2126,7 @@
</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="cx" style="display: block; padding: 0 10px"> * the data instead of printing it.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|boolean Raw XML data, false if the cache is used
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false Raw XML data, false if the cache is used
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_raw_data()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1970,8 +2162,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * top).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $mime MIME type to serve the page as
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function handle_content_type($mime = 'text/html')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function handle_content_type(string $mime = 'text/html')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!headers_sent()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $header = "Content-type: $mime;";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1987,28 +2180,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the type of the feed
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * This returns a \SimplePie\SimplePie::TYPE_* constant, which can be tested against
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This returns a self::TYPE_* constant, which can be tested against
</ins><span class="cx" style="display: block; padding: 0 10px"> * using {@link http://php.net/language.operators.bitwise bitwise operators}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.8 (usage changed to using constants in 1.0)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see \SimplePie\SimplePie::TYPE_NONE Unknown.
- * @see \SimplePie\SimplePie::TYPE_RSS_090 RSS 0.90.
- * @see \SimplePie\SimplePie::TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape).
- * @see \SimplePie\SimplePie::TYPE_RSS_091_USERLAND RSS 0.91 (Userland).
- * @see \SimplePie\SimplePie::TYPE_RSS_091 RSS 0.91.
- * @see \SimplePie\SimplePie::TYPE_RSS_092 RSS 0.92.
- * @see \SimplePie\SimplePie::TYPE_RSS_093 RSS 0.93.
- * @see \SimplePie\SimplePie::TYPE_RSS_094 RSS 0.94.
- * @see \SimplePie\SimplePie::TYPE_RSS_10 RSS 1.0.
- * @see \SimplePie\SimplePie::TYPE_RSS_20 RSS 2.0.x.
- * @see \SimplePie\SimplePie::TYPE_RSS_RDF RDF-based RSS.
- * @see \SimplePie\SimplePie::TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format).
- * @see \SimplePie\SimplePie::TYPE_RSS_ALL Any version of RSS.
- * @see \SimplePie\SimplePie::TYPE_ATOM_03 Atom 0.3.
- * @see \SimplePie\SimplePie::TYPE_ATOM_10 Atom 1.0.
- * @see \SimplePie\SimplePie::TYPE_ATOM_ALL Any version of Atom.
- * @see \SimplePie\SimplePie::TYPE_ALL Any known/supported feed type.
- * @return int \SimplePie\SimplePie::TYPE_* constant
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see self::TYPE_NONE Unknown.
+ * @see self::TYPE_RSS_090 RSS 0.90.
+ * @see self::TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape).
+ * @see self::TYPE_RSS_091_USERLAND RSS 0.91 (Userland).
+ * @see self::TYPE_RSS_091 RSS 0.91.
+ * @see self::TYPE_RSS_092 RSS 0.92.
+ * @see self::TYPE_RSS_093 RSS 0.93.
+ * @see self::TYPE_RSS_094 RSS 0.94.
+ * @see self::TYPE_RSS_10 RSS 1.0.
+ * @see self::TYPE_RSS_20 RSS 2.0.x.
+ * @see self::TYPE_RSS_RDF RDF-based RSS.
+ * @see self::TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format).
+ * @see self::TYPE_RSS_ALL Any version of RSS.
+ * @see self::TYPE_ATOM_03 Atom 0.3.
+ * @see self::TYPE_ATOM_10 Atom 1.0.
+ * @see self::TYPE_ATOM_ALL Any version of Atom.
+ * @see self::TYPE_ALL Any known/supported feed type.
+ * @return int-mask-of<self::TYPE_*> constant
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_type()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2093,7 +2286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * iff it is a 301 redirection
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function subscribe_url($permanent = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function subscribe_url(bool $permanent = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($permanent) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->permanent_url !== null) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2151,9 +2344,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $namespace The URL of the XML namespace of the elements you're trying to access
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tag Tag name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<array<string, mixed>>|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_feed_tags($namespace, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_feed_tags(string $namespace, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->get_type();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($type & self::TYPE_ATOM_10) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2191,9 +2384,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $namespace The URL of the XML namespace of the elements you're trying to access
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tag Tag name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<array<string, mixed>>|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_channel_tags($namespace, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_channel_tags(string $namespace, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->get_type();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($type & self::TYPE_ATOM_ALL) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2237,9 +2430,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $namespace The URL of the XML namespace of the elements you're trying to access
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tag Tag name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<array<string, mixed>>|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_image_tags($namespace, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_image_tags(string $namespace, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $type = $this->get_type();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($type & self::TYPE_RSS_10) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2269,24 +2462,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the base URL value from the feed
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Uses `<xml:base>` if available, otherwise uses the first link in the
- * feed, or failing that, the URL of the feed itself.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Uses `<xml:base>` if available,
+ * otherwise uses the first 'self' link or the first 'alternate' link of the feed,
+ * or failing that, the URL of the feed itself.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_link
</span><span class="cx" style="display: block; padding: 0 10px"> * @see subscribe_url
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $element
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<string, mixed> $element
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_base($element = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_base(array $element = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $element['xml_base'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ($this->get_link() !== null) {
- return $this->get_link();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($link = $this->get_link(0, 'alternate')) !== null) {
+ return $link;
+ }
+ if (($link = $this->get_link(0, 'self')) !== null) {
+ return $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 $this->subscribe_url();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->subscribe_url() ?? '';
</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">@@ -2293,17 +2491,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Sanitize feed data
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see \SimplePie\Sanitize::sanitize()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see Sanitize::sanitize()
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Data to sanitize
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $type One of the \SimplePie\SimplePie::CONSTRUCT_* constants
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $base Base URL to resolve URLs against
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Sanitized data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function sanitize($data, $type, $base = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function sanitize(string $data, int $type, string $base = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations.
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->sanitize->sanitize($data, $type, $base);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } catch (\SimplePie\Exception $e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } catch (SimplePieException $e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!$this->enable_exceptions) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->error = $e->getMessage();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry->call(Misc::class, 'error', [$this->error, E_USER_WARNING, $e->getFile(), $e->getLine()]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2348,9 +2547,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Unknown
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return \SimplePie\Category|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Category|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_category($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_category(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = $this->get_categories();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($categories[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2366,7 +2565,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<atom:category>`, `<category>` or `<dc:subject>`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Unknown
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null List of {@see \SimplePie\Category} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<Category>|null List of {@see Category} objects
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2417,9 +2616,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return \SimplePie\Author|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Author|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_author($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_author(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $authors = $this->get_authors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($authors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2435,7 +2634,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null List of {@see \SimplePie\Author} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<Author>|null List of {@see Author} objects
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_authors()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2448,7 +2647,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($author['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'], self::CONSTRUCT_IRI, $this->get_base($author['child'][self::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $author['child'][self::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], self::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2465,7 +2665,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author[0]['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'], self::CONSTRUCT_IRI, $this->get_base($author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], self::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author[0]['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2496,9 +2697,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return \SimplePie\Author|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Author|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_contributor($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_contributor(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $contributors = $this->get_contributors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2514,7 +2715,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses `<atom:contributor>`
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null List of {@see \SimplePie\Author} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<Author>|null List of {@see Author} objects
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_contributors()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2527,7 +2728,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'], self::CONSTRUCT_IRI, $this->get_base($contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], self::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2544,7 +2746,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'], self::CONSTRUCT_IRI, $this->get_base($contributor['child'][self::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $contributor['child'][self::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], self::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'], self::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2569,7 +2772,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rel The relationship of the link to return
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|null Link URL
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_link($key = 0, $rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_link(int $key = 0, string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $this->get_links($rel);
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($links[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2602,9 +2805,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rel The relationship of links to return
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null Links found for the feed (strings)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<string>|null Links found for the feed (strings)
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_links($rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_links(string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['links'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'] = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2669,6 +2872,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 ?array<Response>
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_all_discovered_feeds()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->all_discovered_feeds;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2772,7 +2978,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.georss.org/ GeoRSS
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return float|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_latitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2795,7 +3001,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://www.georss.org/ GeoRSS
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return float|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_longitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2942,15 +3148,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $max Maximum value to return. 0 for no limit
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int Number of items in the feed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_item_quantity($max = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_item_quantity(int $max = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $max = (int) $max;
</del><span class="cx" style="display: block; padding: 0 10px"> $qty = count($this->get_items());
</span><span class="cx" style="display: block; padding: 0 10px"> if ($max === 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $qty;
</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">- return ($qty > $max) ? $max : $qty;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return min($qty, $max);
</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">@@ -2963,9 +3168,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_item_quantity()
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return \SimplePie\Item|null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Item|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_item($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_item(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $items = $this->get_items();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($items[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2986,9 +3191,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Beta 2
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $start Index to start at
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $end Number of items to return. 0 for all items after `$start`
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return \SimplePie\Item[]|null List of {@see \SimplePie\Item} objects
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return Item[] List of {@see Item} objects
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_items($start = 0, $end = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_items(int $start = 0, int $end = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['items'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!empty($this->multifeed_objects)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3002,31 +3207,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ($items = $this->get_feed_tags(self::NAMESPACE_ATOM_10, 'entry')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($items);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['items'][] = $this->registry->create(Item::class, [$this, $items[$key]]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['items'][] = $this->make_item($items[$key]);
</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"> if ($items = $this->get_feed_tags(self::NAMESPACE_ATOM_03, 'entry')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($items);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['items'][] = $this->registry->create(Item::class, [$this, $items[$key]]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['items'][] = $this->make_item($items[$key]);
</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"> if ($items = $this->get_feed_tags(self::NAMESPACE_RSS_10, 'item')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($items);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['items'][] = $this->registry->create(Item::class, [$this, $items[$key]]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['items'][] = $this->make_item($items[$key]);
</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"> if ($items = $this->get_feed_tags(self::NAMESPACE_RSS_090, 'item')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($items);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['items'][] = $this->registry->create(Item::class, [$this, $items[$key]]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['items'][] = $this->make_item($items[$key]);
</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"> if ($items = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'item')) {
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($items);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->data['items'][] = $this->registry->create(Item::class, [$this, $items[$key]]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->data['items'][] = $this->make_item($items[$key]);
</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">@@ -3056,10 +3261,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the favicon handler
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use your own favicon handling instead
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|false $page
+ * @return bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_favicon_handler($page = false, $qs = 'i')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_favicon_handler($page = false, string $qs = 'i')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error('Favicon handling has been removed, please use your own handling', \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error('Favicon handling has been removed since SimplePie 1.3, please use your own handling', \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">@@ -3067,10 +3274,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the favicon for the current feed
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated Use your own favicon handling instead
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_favicon()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error('Favicon handling has been removed, please use your own handling', \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error('Favicon handling has been removed since SimplePie 1.3, please use your own handling', \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (($url = $this->get_link()) !== null) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'https://www.google.com/s2/favicons?domain=' . urlencode($url);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3083,36 +3291,49 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Magic method handler
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $method Method name
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $args Arguments to the method
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<mixed> $args Arguments to the method
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __call($method, $args)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __call(string $method, array $args)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (strpos($method, 'subscribe_') === 0) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error('subscribe_*() has been deprecated, implement the callback yourself', \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error('subscribe_*() has been deprecated since SimplePie 1.3, implement the callback yourself', \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ($method === 'enable_xml_dump') {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', \E_USER_DEPRECATED);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trigger_error('enable_xml_dump() has been deprecated since SimplePie 1.3, use get_raw_data() instead', \E_USER_DEPRECATED);
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</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"> $class = get_class($this);
</span><span class="cx" style="display: block; padding: 0 10px"> $trace = debug_backtrace(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file = $trace[0]['file'];
- $line = $trace[0]['line'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file = $trace[0]['file'] ?? '';
+ $line = $trace[0]['line'] ?? '';
</ins><span class="cx" style="display: block; padding: 0 10px"> throw new SimplePieException("Call to undefined method $class::$method() in $file on line $line");
</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">+ * Item factory
+ *
+ * @param array<string, mixed> $data
+ */
+ private function make_item(array $data): Item
+ {
+ $item = $this->registry->create(Item::class, [$this, $data]);
+ $item->set_sanitize($this->sanitize);
+
+ return $item;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Sorting callback for items
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param SimplePie $a
- * @param SimplePie $b
- * @return boolean
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param Item $a
+ * @param Item $b
+ * @return -1|0|1
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function sort_items($a, $b)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function sort_items(Item $a, Item $b)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $a_date = $a->get_date('U');
</span><span class="cx" style="display: block; padding: 0 10px"> $b_date = $b->get_date('U');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3136,19 +3357,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * for the items or else SimplePie will refuse to sort them.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $urls List of SimplePie feed objects to merge
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array<SimplePie> $urls List of SimplePie feed objects to merge
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $start Starting item
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $end Number of items to return
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $limit Maximum number of items per feed
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array<Item>
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function merge_items($urls, $start = 0, $end = 0, $limit = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function merge_items(array $urls, int $start = 0, int $end = 0, int $limit = 0)
</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 (is_array($urls) && sizeof($urls) > 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (count($urls) > 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $items = [];
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($urls as $arg) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($arg instanceof SimplePie) {
</span><span class="cx" style="display: block; padding: 0 10px"> $items = array_merge($items, $arg->get_items(0, $limit));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // @phpstan-ignore-next-line Enforce PHPDoc type.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error('Arguments must be SimplePie objects', E_USER_WARNING);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3172,31 +3395,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * There is no way to find PuSH links in the body of a microformats feed,
</span><span class="cx" style="display: block; padding: 0 10px"> * so they are added to the headers when found, to be used later by get_links.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param \SimplePie\File $file
- * @param string $hub
- * @param string $self
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function store_links(&$file, $hub, $self)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function store_links(Response $file, ?string $hub, ?string $self): Response
</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 (isset($file->headers['link']['hub']) ||
- (isset($file->headers['link']) &&
- preg_match('/rel=hub/', $file->headers['link']))) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $linkHeaderLine = $file->get_header_line('link');
+ $linkHeader = $file->get_header('link');
+
+ if ($hub && !preg_match('/rel=hub/', $linkHeaderLine)) {
+ $linkHeader[] = '<'.$hub.'>; rel=hub';
</ins><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 ($hub) {
- if (isset($file->headers['link'])) {
- if ($file->headers['link'] !== '') {
- $file->headers['link'] = ', ';
- }
- } else {
- $file->headers['link'] = '';
- }
- $file->headers['link'] .= '<'.$hub.'>; rel=hub';
- if ($self) {
- $file->headers['link'] .= ', <'.$self.'>; rel=self';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($self && !preg_match('/rel=self/', $linkHeaderLine)) {
+ $linkHeader[] = '<'.$self.'>; rel=self';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if (count($linkHeader) > 0) {
+ $file = $file->with_header('link', $linkHeader);
+ }
+
+ return $file;
</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">@@ -3206,7 +3423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return DataCache
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function get_cache($feed_url = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function get_cache(string $feed_url = ''): DataCache
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->cache === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> // @trigger_error(sprintf('Not providing as PSR-16 cache implementation is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()".'), \E_USER_DEPRECATED);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3221,6 +3438,28 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->cache;
</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 a HTTP client
+ */
+ private function get_http_client(): Client
+ {
+ if ($this->http_client === null) {
+ $this->http_client = new FileClient(
+ $this->get_registry(),
+ [
+ 'timeout' => $this->timeout,
+ 'redirects' => 5,
+ 'useragent' => $this->useragent,
+ 'force_fsockopen' => $this->force_fsockopen,
+ 'curl_options' => $this->curl_options,
+ ]
+ );
+ $this->http_client_injected = true;
+ }
+
+ return $this->http_client;
+ }
</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"> class_alias('SimplePie\SimplePie', 'SimplePie');
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcSourcephp"></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/src/Source.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/Source.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/Source.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie;
</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">@@ -50,33 +13,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by {@see \SimplePie\Item::get_source()}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This class can be overloaded with {@see \SimplePie::set_source_class()}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage API
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Source implements RegistryAware
</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 Item */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $item;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /** @var array<string, mixed> */
</ins><span class="cx" style="display: block; padding: 0 10px"> public $data = [];
</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"> protected $registry;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($item, $data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, mixed> $data
+ */
+ public function __construct(Item $item, array $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->item = $item;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = $data;
</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">- public function set_registry(\SimplePie\Registry $registry)/* : void */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return void
+ */
+ public function set_registry(\SimplePie\Registry $registry)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry = $registry;
</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 string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function __toString()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return md5(serialize($this->data));
</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">- public function get_source_tags($namespace, $tag)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $namespace
+ * @param string $tag
+ * @return array<array<string, mixed>>|null
+ */
+ public function get_source_tags(string $namespace, string $tag)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->data['child'][$namespace][$tag])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->data['child'][$namespace][$tag];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,21 +62,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_base($element = [])
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array<string, mixed> $element
+ * @return string
+ */
+ public function get_base(array $element = [])
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->item->get_base($element);
</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">- public function sanitize($data, $type, $base = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $data
+ * @param int-mask-of<SimplePie::CONSTRUCT_*> $type
+ * @param string $base
+ * @return string
+ */
+ public function sanitize(string $data, $type, string $base = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->item->sanitize($data, $type, $base);
</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 Item
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_item()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->item;
</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 string|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_title()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'title')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +114,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_category($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int $key
+ * @return Category|null
+ */
+ public function get_category(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = $this->get_categories();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($categories[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,6 +128,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 array<Category>|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_categories()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_author($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int $key
+ * @return Author|null
+ */
+ public function get_author(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $authors = $this->get_authors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($authors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,6 +189,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 array<Author>|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_authors()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $authors = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,7 +203,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,7 +221,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,7 +248,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_contributor($key = 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int $key
+ * @return Author|null
+ */
+ public function get_contributor(int $key = 0)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $contributors = $this->get_contributors();
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributors[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,6 +262,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 array<Author>|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contributors()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $contributors = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +276,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $uri = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $uri = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0];
+ $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,7 +294,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0];
+ $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +312,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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">- public function get_link($key = 0, $rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param int $key
+ * @param string $rel
+ * @return string|null
+ */
+ public function get_link(int $key = 0, string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $this->get_links($rel);
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($links[$key])) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,6 +329,8 @@
</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"> * Added for parity between the parent-level and the item/entry-level.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return string|null
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_permalink()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +337,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->get_link(0);
</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">- public function get_links($rel = 'alternate')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $rel
+ * @return array<string>|null
+ */
+ public function get_links(string $rel = 'alternate')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!isset($this->data['links'])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'] = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,6 +373,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys($this->data['links']);
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($keys as $key) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $key = (string) $key;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->registry->call(Misc::class, 'is_isegment_nz_nc', [$key])) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (isset($this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key])) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,6 +396,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 string|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_description()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'subtitle')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,6 +424,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 string|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_copyright()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'rights')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -407,6 +444,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 string|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_language()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'language')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,6 +462,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 float|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_latitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lat')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,6 +476,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 float|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_longitude()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'long')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,6 +492,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</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 string|null
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_image_url()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'image')) {
</span></span></pre></div>
<a id="trunksrcwpincludesSimplePiesrcXMLDeclarationParserphp"></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/src/XML/Declaration/Parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/SimplePie/src/XML/Declaration/Parser.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/SimplePie/src/XML/Declaration/Parser.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * * Neither the name of the SimplePie Team nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Sam Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
+// SPDX-License-Identifier: BSD-3-Clause
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+declare(strict_types=1);
+
</ins><span class="cx" style="display: block; padding: 0 10px"> namespace SimplePie\XML\Declaration;
</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"> * Parses the XML Declaration
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @package SimplePie
- * @subpackage Parsing
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Parser
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $data Input data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct($data)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct(string $data)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data = $data;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->data_length = strlen($this->data);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool true on success, false on failure
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function parse()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function parse(): bool
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> while ($this->state && $this->state !== self::STATE_EMIT && $this->has_data()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $state = $this->state;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,9 +121,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- $this->version = '';
- $this->encoding = '';
- $this->standalone = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Reset the parser state.
+ $this->version = '1.0';
+ $this->encoding = 'UTF-8';
+ $this->standalone = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">@@ -173,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool true if there is further data, false if not
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function has_data()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function has_data(): bool
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return (bool) ($this->position < $this->data_length);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,6 +153,8 @@
</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"> * Read value
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return string|false
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_value()
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- public function before_version_name()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function before_version_name(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->skip_whitespace()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_VERSION_NAME;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,7 +180,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function version_name()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function version_name(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 7) === 'version') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position += 7;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,7 +191,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function version_equals()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function version_equals(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 1) === '=') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position++;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,9 +202,10 @@
</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">- public function version_value()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function version_value(): void
</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 ($this->version = $this->get_value()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($version = $this->get_value()) {
+ $this->version = $version;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->skip_whitespace();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->has_data()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_ENCODING_NAME;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +217,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function encoding_name()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function encoding_name(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 8) === 'encoding') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position += 8;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +228,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function encoding_equals()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function encoding_equals(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 1) === '=') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position++;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,9 +239,10 @@
</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">- public function encoding_value()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function encoding_value(): void
</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 ($this->encoding = $this->get_value()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($encoding = $this->get_value()) {
+ $this->encoding = $encoding;
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->skip_whitespace();
</span><span class="cx" style="display: block; padding: 0 10px"> if ($this->has_data()) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->state = self::STATE_STANDALONE_NAME;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,7 +254,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function standalone_name()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function standalone_name(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 10) === 'standalone') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position += 10;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +265,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function standalone_equals()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function standalone_equals(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (substr($this->data, $this->position, 1) === '=') {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->position++;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,7 +276,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function standalone_value()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function standalone_value(): void
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($standalone = $this->get_value()) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ($standalone) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpsimplepiefilephp"></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-wp-simplepie-file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-simplepie-file.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/class-wp-simplepie-file.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,6 +75,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->headers = wp_remote_retrieve_headers( $res );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $this->headers instanceof \WpOrg\Requests\Utility\CaseInsensitiveDictionary ) {
+ $this->headers = $this->headers->getAll();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * SimplePie expects multiple headers to be stored as a comma-separated string,
</span><span class="cx" style="display: block; padding: 0 10px"> * but `wp_remote_retrieve_headers()` returns them as an array, so they need
</span></span></pre></div>
<a id="trunksrcwpincludesfeedphp"></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/feed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/feed.php 2025-09-16 17:37:43 UTC (rev 60770)
+++ trunk/src/wp-includes/feed.php 2025-09-16 22:45:37 UTC (rev 60771)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -812,7 +812,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $feed = new SimplePie\SimplePie();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $feed->get_registry()->register( SimplePie\Sanitize::class, 'WP_SimplePie_Sanitize_KSES', true );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * We must manually overwrite $feed->sanitize because SimplePie's constructor
</span><span class="cx" style="display: block; padding: 0 10px"> * sets it before we have a chance to set the sanitization class.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -829,7 +830,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $feed->set_cache_class( 'WP_Feed_Cache' );
</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">- $feed->set_file_class( 'WP_SimplePie_File' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $feed->get_registry()->register( SimplePie\File::class, 'WP_SimplePie_File', true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $feed->set_feed_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/class-wp-feed-cache-transient.php */
</span></span></pre>
</div>
</div>
</body>
</html>