<!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>[54545] branches/5.9: Grouped backports to the 5.9 branch.</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/54545">54545</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/54545","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>audrasjb</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-10-17 17:39:34 +0000 (Mon, 17 Oct 2022)</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'>Grouped backports to the 5.9 branch.
- Editor: Bump @wordpress packages for the 5.9 branch,
- Media: Refactor search by filename within the admin,
- REST API: Lockdown post parameter of the terms endpoint,
- Customize: Escape blogname option in underscores templates,
- Query: Validate relation in `WP_Date_Query`,
- Users: Revert use of shared objects for current user,
- Posts, Post types: Apply KSES to post-by-email content,
- General: Validate host on "Are you sure?" screen,
- Posts, Post types: Remove emails from post-by-email logs,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Mail: Reset PHPMailer properties between use,
- Comments: Apply kses when editing comments,
- Widgets: Escape RSS error messages for display.
Merges [54521-54530] to the 5.9 branch.
Props audrasjb, costdev, cu121, dd32, davidbaumwald, ehtis, johnbillion, johnjamesjacoby, martinkrcho, matveb, oztaser, paulkevan, peterwilsoncc, ravipatel, SergeyBiryukov, talldanwp, timothyblynjacobs, tykoted, voldemortensen, vortfu, xknown.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches59packagejson">branches/5.9/package.json</a></li>
<li><a href="#branches59srcwpadminincludesajaxactionsphp">branches/5.9/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#branches59srcwpadminincludespostphp">branches/5.9/src/wp-admin/includes/post.php</a></li>
<li><a href="#branches59srcwpincludesclasswpdatequeryphp">branches/5.9/src/wp-includes/class-wp-date-query.php</a></li>
<li><a href="#branches59srcwpincludesclasswpqueryphp">branches/5.9/src/wp-includes/class-wp-query.php</a></li>
<li><a href="#branches59srcwpincludescommentphp">branches/5.9/src/wp-includes/comment.php</a></li>
<li><a href="#branches59srcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp">branches/5.9/src/wp-includes/customize/class-wp-customize-header-image-control.php</a></li>
<li><a href="#branches59srcwpincludescustomizeclasswpcustomizesiteiconcontrolphp">branches/5.9/src/wp-includes/customize/class-wp-customize-site-icon-control.php</a></li>
<li><a href="#branches59srcwpincludesdeprecatedphp">branches/5.9/src/wp-includes/deprecated.php</a></li>
<li><a href="#branches59srcwpincludesfunctionsphp">branches/5.9/src/wp-includes/functions.php</a></li>
<li><a href="#branches59srcwpincludesmediatemplatephp">branches/5.9/src/wp-includes/media-template.php</a></li>
<li><a href="#branches59srcwpincludespluggablephp">branches/5.9/src/wp-includes/pluggable.php</a></li>
<li><a href="#branches59srcwpincludespostphp">branches/5.9/src/wp-includes/post.php</a></li>
<li><a href="#branches59srcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp">branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</a></li>
<li><a href="#branches59srcwpincludesrestapiendpointsclasswpresttermscontrollerphp">branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php</a></li>
<li><a href="#branches59srcwpincludesuserphp">branches/5.9/src/wp-includes/user.php</a></li>
<li><a href="#branches59srcwpincludeswidgetsphp">branches/5.9/src/wp-includes/widgets.php</a></li>
<li><a href="#branches59srcwpmailphp">branches/5.9/src/wp-mail.php</a></li>
<li><a href="#branches59srcwptrackbackphp">branches/5.9/src/wp-trackback.php</a></li>
<li><a href="#branches59testsphpunittestspluggablephp">branches/5.9/tests/phpunit/tests/pluggable.php</a></li>
<li><a href="#branches59testsphpunittestsquerysearchphp">branches/5.9/tests/phpunit/tests/query/search.php</a></li>
<li><a href="#branches59testsphpunittestsrestapirestcommentscontrollerphp">branches/5.9/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#branches59">branches/5.9/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/5.9
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/5.9 2022-10-17 16:53:54 UTC (rev 54544)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/5.9 2022-10-17 17:39:34 UTC (rev 54545)
</ins><a id="branches59"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/5.9</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/5.0:43681-43682,43684-43688,43719-43720,43723,43726-43727,43729-43731,43734-43744,43747,43751-43754,43758,43760-43765,43767-43770,43772,43774-43781,43783,43785,43790-43806,43808-43821,43825,43828,43830-43834,43836-43843,43846-43863,43867-43889,43891-43894,43897-43905,43908-43909,43911-43929,43931-43942,43946-43947,43949-43956,43959-43964,43967-43969,43988,43994,44014,44017,44047,44183,44185,44187-44206,44208-44213,44231-44232,44235,44248,44284,44287-44288
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.5:49373-49379,49381
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.8:51889
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk:52453-52457,52535-52536,52547,52555,52558,52562-52563,52574,52589,52612-52613,52618,52626,52628,52631,52633,52637,52644,52648,52651,52656,52658,52662,52664,52668,52672-52673,52675-52677,52679,52681-52682,52686,52692,52694-52695,52697,52726,52730,52733-52735,52738,52741,52743-52744,52750,52752,52754,52757,52760,52763,52765,52768,52781,52791,52797,52802,52807,52819,52844,52895,52939,52995,53012,53015,53020,53024-53025,53112,53349,53581-53582,53592,53665,53958-53960,54217,54322
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/trunk:52453-52457,52535-52536,52547,52555,52558,52562-52563,52574,52589,52612-52613,52618,52626,52628,52631,52633,52637,52644,52648,52651,52656,52658,52662,52664,52668,52672-52673,52675-52677,52679,52681-52682,52686,52692,52694-52695,52697,52726,52730,52733-52735,52738,52741,52743-52744,52750,52752,52754,52757,52760,52763,52765,52768,52781,52791,52797,52802,52807,52819,52844,52895,52939,52995,53012,53015,53020,53024-53025,53112,53349,53581-53582,53592,53665,53958-53960,54217,54322,54397,54521-54530,54541
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches59packagejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/package.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/package.json 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/package.json 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,15 +82,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/api-fetch": "5.2.7",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/autop": "3.2.3",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/blob": "3.2.2",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/block-directory": "3.0.29",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/block-directory": "3.0.30",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/block-editor": "8.0.18",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/block-library": "6.0.28",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/block-library": "6.0.29",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/block-serialization-default-parser": "4.2.3",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/blocks": "11.1.5",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/components": "19.2.3",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/compose": "5.0.7",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/core-data": "4.0.11",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/customize-widgets": "2.0.29",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/customize-widgets": "2.0.30",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/data": "6.1.5",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/data-controls": "2.2.9",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/date": "4.2.3",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,9 +97,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/deprecated": "3.2.3",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/dom": "3.2.7",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/dom-ready": "3.2.3",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/edit-post": "5.0.29",
- "@wordpress/edit-site": "3.0.29",
- "@wordpress/edit-widgets": "3.1.24",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/edit-post": "5.0.30",
+ "@wordpress/edit-site": "3.0.30",
+ "@wordpress/edit-widgets": "3.1.25",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/editor": "12.0.22",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/element": "4.0.4",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/escape-html": "2.2.3",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,7 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/url": "3.3.2",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/viewport": "4.0.7",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/warning": "2.2.2",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/widgets": "2.0.24",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/widgets": "2.0.25",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/wordcount": "3.2.3",
</span><span class="cx" style="display: block; padding: 0 10px"> "backbone": "1.4.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "clipboard": "2.0.8",
</span></span></pre></div>
<a id="branches59srcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-admin/includes/ajax-actions.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-admin/includes/ajax-actions.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2984,7 +2984,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter query clauses to include filenames.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $query['s'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__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></pre></div>
<a id="branches59srcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-admin/includes/post.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-admin/includes/post.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1302,7 +1302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter query clauses to include filenames.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $q['s'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__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"> return $q;
</span></span></pre></div>
<a id="branches59srcwpincludesclasswpdatequeryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/class-wp-date-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/class-wp-date-query.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/class-wp-date-query.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,8 +149,8 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] ) ) {
- $this->relation = 'OR';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $date_query['relation'] ) ) {
+ $this->relation = $this->sanitize_relation( $date_query['relation'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->relation = 'AND';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,6 +219,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->validate_date_values( $queries );
</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">+ // Sanitize the relation parameter.
+ $queries['relation'] = $this->sanitize_relation( $queries['relation'] );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $queries as $key => $q ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $q ) || in_array( $key, $this->time_keys, true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // This is a first-order query. Trust the values and sanitize when building SQL.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1040,4 +1043,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $wpdb->prepare( "DATE_FORMAT( $column, %s ) $compare %f", $format, $time );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Sanitizes a 'relation' operator.
+ *
+ * @since 6.0.3
+ *
+ * @param string $relation Raw relation key from the query argument.
+ * @return string Sanitized relation ('AND' or 'OR').
+ */
+ public function sanitize_relation( $relation ) {
+ if ( 'OR' === strtoupper( $relation ) ) {
+ return 'OR';
+ } else {
+ return 'AND';
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="branches59srcwpincludesclasswpqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/class-wp-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/class-wp-query.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/class-wp-query.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -445,6 +445,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $thumbnails_cached = 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">+ * Controls whether an attachment query should include filenames or not.
+ *
+ * @since 6.0.3
+ * @var bool
+ */
+ protected $allow_query_attachment_by_filename = false;
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Cached list of search stopwords.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1414,7 +1421,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"> $like = $n . $wpdb->esc_like( $term ) . $n;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s))", $like, $like, $like );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! empty( $this->allow_query_attachment_by_filename ) ) {
+ $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s) $andor_op (sq1.meta_value $like_op %s))", $like, $like, $like, $like );
+ } else {
+ $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s))", $like, $like, $like );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $searchand = ' AND ';
</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">@@ -1809,6 +1821,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fill again in case 'pre_get_posts' unset some vars.
</span><span class="cx" style="display: block; padding: 0 10px"> $q = $this->fill_query_vars( $q );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters whether an attachment query should include filenames or not.
+ *
+ * @since 6.0.3
+ *
+ * @param bool $allow_query_attachment_by_filename Whether or not to include filenames.
+ */
+ $this->allow_query_attachment_by_filename = apply_filters( 'wp_allow_query_attachment_by_filename', false );
+ remove_all_filters( 'wp_allow_query_attachment_by_filename' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Parse meta query.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->meta_query = new WP_Meta_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->meta_query->parse_query_vars( $q );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2240,7 +2262,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 ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) || ! empty( $this->allow_query_attachment_by_filename ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $groupby = "{$wpdb->posts}.ID";
</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">@@ -2317,6 +2339,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $where .= $search . $whichauthor . $whichmimetype;
</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 ( ! empty( $this->allow_query_attachment_by_filename ) ) {
+ $join .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $this->meta_query->queries ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $clauses = $this->meta_query->get_sql( 'post', $wpdb->posts, 'ID', $this );
</span><span class="cx" style="display: block; padding: 0 10px"> $join .= $clauses['join'];
</span></span></pre></div>
<a id="branches59srcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/comment.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/comment.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2486,6 +2486,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">+ $filter_comment = false;
+ if ( ! has_filter( 'pre_comment_content', 'wp_filter_kses' ) ) {
+ $filter_comment = ! user_can( isset( $comment['user_id'] ) ? $comment['user_id'] : 0, 'unfiltered_html' );
+ }
+
+ if ( $filter_comment ) {
+ add_filter( 'pre_comment_content', 'wp_filter_kses' );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Escape data pulled from DB.
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = wp_slash( $comment );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2496,6 +2505,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $commentarr = wp_filter_comment( $commentarr );
</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 ( $filter_comment ) {
+ remove_filter( 'pre_comment_content', 'wp_filter_kses' );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Now extract the merged array.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = wp_unslash( $commentarr );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="branches59srcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/customize/class-wp-customize-header-image-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/customize/class-wp-customize-header-image-control.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/customize/class-wp-customize-header-image-control.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,10 +130,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <# } else { #>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <button type="button" class="choice thumbnail"
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- data-customize-image-value="{{{data.header.url}}}"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ data-customize-image-value="{{data.header.url}}"
</ins><span class="cx" style="display: block; padding: 0 10px"> data-customize-header-image-data="{{JSON.stringify(data.header)}}">
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="screen-reader-text"><?php _e( 'Set image' ); ?></span>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />
</ins><span class="cx" style="display: block; padding: 0 10px"> </button>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <# if ( data.type === 'uploaded' ) { #>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,7 +158,7 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />
</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"> <# } else { #>
</span></span></pre></div>
<a id="branches59srcwpincludescustomizeclasswpcustomizesiteiconcontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/customize/class-wp-customize-site-icon-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/customize/class-wp-customize-site-icon-control.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/customize/class-wp-customize-site-icon-control.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="favicon">
</span><span class="cx" style="display: block; padding: 0 10px"> <img src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="browser-title" aria-hidden="true"><# print( '<?php bloginfo( 'name' ); ?>' ) #></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="browser-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <img class="app-icon-preview" src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="branches59srcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/deprecated.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/deprecated.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4225,3 +4225,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '5.9.1', 'wp_get_duotone_filter_property()' );
</span><span class="cx" style="display: block; padding: 0 10px"> return wp_get_duotone_filter_property( $preset );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Filter the SQL clauses of an attachment query to include filenames.
+ *
+ * @since 4.7.0
+ * @deprecated 6.0.3
+ * @access private
+ *
+ * @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
+ * DISTINCT, fields (SELECT), and LIMITS clauses.
+ * @return array The unmodified clauses.
+ */
+function _filter_query_attachment_filenames( $clauses ) {
+ _deprecated_function( __FUNCTION__, '6.0.3', 'add_filter( "wp_allow_query_attachment_by_filename", "__return_true" )');
+ remove_filter( 'posts_clauses', __FUNCTION__ );
+ return $clauses;
+}
+
</ins></span></pre></div>
<a id="branches59srcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/functions.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/functions.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3528,10 +3528,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $html = __( 'The link you followed has expired.' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_get_referer() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() );
+ $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $html .= '</p><p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $html .= sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<a href="%s">%s</a>',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ esc_url( $wp_http_referer ),
</ins><span class="cx" style="display: block; padding: 0 10px"> __( 'Please try again.' )
</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="branches59srcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/media-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/media-template.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/media-template.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1493,7 +1493,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="favicon">
</span><span class="cx" style="display: block; padding: 0 10px"> <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="browser-title" aria-hidden="true"><# print( '<?php bloginfo( 'name' ); ?>' ) #></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <span class="browser-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <strong aria-hidden="true"><?php _e( 'As an app icon' ); ?></strong>
</span></span></pre></div>
<a id="branches59srcwpincludespluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/pluggable.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/pluggable.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,7 +91,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 5.8.0 Returns the global `$current_user` if it's the user being fetched.
</del><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_User $current_user The current user object which holds the user data.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,8 +99,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return WP_User|false WP_User object on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_user_by( $field, $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $current_user;
-
</del><span class="cx" style="display: block; padding: 0 10px"> $userdata = WP_User::get_data_by( $field, $value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $userdata ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,10 +105,6 @@
</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">- if ( $current_user instanceof WP_User && $current_user->ID === (int) $userdata->ID ) {
- return $current_user;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User;
</span><span class="cx" style="display: block; padding: 0 10px"> $user->init( $userdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,6 +354,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $phpmailer->clearAttachments();
</span><span class="cx" style="display: block; padding: 0 10px"> $phpmailer->clearCustomHeaders();
</span><span class="cx" style="display: block; padding: 0 10px"> $phpmailer->clearReplyTos();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $phpmailer->Body = '';
+ $phpmailer->AltBody = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set "From" name and email.
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="branches59srcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/post.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/post.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7927,36 +7927,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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Filters the SQL clauses of an attachment query to include filenames.
- *
- * @since 4.7.0
- * @access private
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
- * DISTINCT, fields (SELECT), and LIMITS clauses.
- * @return string[] The modified array of clauses.
- */
-function _filter_query_attachment_filenames( $clauses ) {
- global $wpdb;
- remove_filter( 'posts_clauses', __FUNCTION__ );
-
- // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.
- $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";
-
- $clauses['groupby'] = "{$wpdb->posts}.ID";
-
- $clauses['where'] = preg_replace(
- "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",
- '$0 OR ( sq1.meta_value $1 $2 )',
- $clauses['where']
- );
-
- return $clauses;
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Sets the last changed time for the 'posts' cache group.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span></span></pre></div>
<a id="branches59srcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter query clauses to include filenames.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $query_args['s'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__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"> return $query_args;
</span></span></pre></div>
<a id="branches59srcwpincludesrestapiendpointsclasswpresttermscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,6 +145,35 @@
</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">+ * Checks if the terms for a post can be read.
+ *
+ * @since 6.0.3
+ *
+ * @param WP_Post $post Post object.
+ * @param WP_REST_Request $request Full details about the request.
+ * @return bool Whether the terms for the post can be read.
+ */
+ public function check_read_terms_permission_for_post( $post, $request ) {
+ // If the requested post isn't associated with this taxonomy, deny access.
+ if ( ! is_object_in_taxonomy( $post->post_type, $this->taxonomy ) ) {
+ return false;
+ }
+
+ // Grant access if the post is publicly viewable.
+ if ( is_post_publicly_viewable( $post ) ) {
+ return true;
+ }
+
+ // Otherwise grant access if the post is readable by the logged in user.
+ if ( current_user_can( 'read_post', $post->ID ) ) {
+ return true;
+ }
+
+ // Otherwise, deny access.
+ return false;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Checks if a request has access to read terms in the specified taxonomy.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.7.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,6 +196,30 @@
</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">+ if ( ! empty( $request['post'] ) ) {
+ $post = get_post( $request['post'] );
+
+ if ( ! $post ) {
+ return new WP_Error(
+ 'rest_post_invalid_id',
+ __( 'Invalid post ID.' ),
+ array(
+ 'status' => 400,
+ )
+ );
+ }
+
+ if ( ! $this->check_read_terms_permission_for_post( $post, $request ) ) {
+ return new WP_Error(
+ 'rest_forbidden_context',
+ __( 'Sorry, you are not allowed to view terms for this post.' ),
+ array(
+ 'status' => rest_authorization_required_code(),
+ )
+ );
+ }
+ }
+
</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></span></pre></div>
<a id="branches59srcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/user.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/user.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1710,15 +1710,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0 'clean_user_cache' action was added.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.
</del><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global WP_User $current_user The current user object which holds the user data.
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User|int $user User object or ID to be cleaned from the cache
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function clean_user_cache( $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $current_user;
-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( is_numeric( $user ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1741,13 +1736,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User $user User object.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'clean_user_cache', $user->ID, $user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- // Refresh the global user instance if the cleaning current user.
- if ( get_current_user_id() === (int) $user->ID ) {
- $user_id = (int) $user->ID;
- $current_user = null;
- wp_set_current_user( $user_id, '' );
- }
</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></pre></div>
<a id="branches59srcwpincludeswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-includes/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-includes/widgets.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-includes/widgets.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1578,7 +1578,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $rss ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_admin() || current_user_can( 'manage_options' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $rss->get_error_message() ) . '</p>';
</ins><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"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1701,7 +1701,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args['show_date'] = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $args['error'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $args['error'] . '</p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $args['error'] ) . '</p>';
</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"> $esc_number = esc_attr( $args['number'] );
</span></span></pre></div>
<a id="branches59srcwpmailphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-mail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-mail.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-mail.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,6 +65,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'There doesn’t seem to be any new mail.' ) );
</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">+// Always run as an unauthenticated user.
+wp_set_current_user( 0 );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 1; $i <= $count; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $message = $pop3->get( $i );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,8 +137,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $author = sanitize_email( $author );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_email( $author ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Post author email address. */
- echo '<p>' . sprintf( __( 'Author is %s' ), $author ) . '</p>';
</del><span class="cx" style="display: block; padding: 0 10px"> $userdata = get_user_by( 'email', $author );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $userdata ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_author = $userdata->ID;
</span></span></pre></div>
<a id="branches59srcwptrackbackphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/src/wp-trackback.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/src/wp-trackback.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/src/wp-trackback.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp( array( 'tb' => '1' ) );
</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">+// Always run as an unauthenticated user.
+wp_set_current_user( 0 );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Response to a trackback.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="branches59testsphpunittestspluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/tests/phpunit/tests/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/tests/phpunit/tests/pluggable.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/tests/phpunit/tests/pluggable.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,20 +323,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $signatures;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- /**
- * @ticket 28020
- */
- public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() {
- // Create a test user.
- $new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );
-
- // Set the test user as the current user.
- $current_user = wp_set_current_user( $new_user );
-
- // Get the test user using get_user_by().
- $from_get_user_by = get_user_by( 'id', $new_user );
-
- $this->assertSame( $current_user, $from_get_user_by );
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="branches59testsphpunittestsquerysearchphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/tests/phpunit/tests/query/search.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/tests/phpunit/tests/query/search.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/tests/phpunit/tests/query/search.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,7 +454,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"> add_post_meta( $attachment, '_wp_attached_file', 'some-image1.png', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass post_type a string value.
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -484,7 +484,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"> add_post_meta( $attachment, '_wp_attached_file', 'some-image2.png', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass post_type an array value.
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,7 +543,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $attachment, '_wp_attached_file', 'some-image4.png', true );
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $attachment, '_test_meta_key', 'value', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass post_type a string value.
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,7 +583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $attachment, 'test', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $attachment, '_wp_attached_file', 'some-image5.png', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass post_type a string value.
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -608,25 +608,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22744
</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 test_filter_query_attachment_filenames_unhooks_itself() {
- add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_wp_query_removes_filter_wp_allow_query_attachment_by_filename() {
+ $attachment = self::factory()->post->create(
+ array(
+ 'post_type' => 'attachment',
+ 'post_status' => 'publish',
+ 'post_title' => 'bar foo',
+ 'post_content' => 'foo bar',
+ 'post_excerpt' => 'This post has foo',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- apply_filters(
- 'posts_clauses',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_post_meta( $attachment, '_wp_attached_file', 'some-image1.png', true );
+ add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' );
+
+ $q = new WP_Query(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'where' => '',
- 'groupby' => '',
- 'join' => '',
- 'orderby' => '',
- 'distinct' => '',
- 'fields' => '',
- 'limit' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 's' => 'image1',
+ 'fields' => 'ids',
+ 'post_type' => 'attachment',
+ 'post_status' => 'inherit',
</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">- $result = has_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $attachment ), $q->posts );
</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->assertFalse( $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * WP_Query should have removed the wp_allow_query_attachment_by_filename filter
+ * and thus not match the attachment created above
+ */
+ $q->get_posts();
+ $this->assertEmpty( $q->posts );
</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"> public function filter_posts_search( $sql ) {
</span></span></pre></div>
<a id="branches59testsphpunittestsrestapirestcommentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.9/tests/phpunit/tests/rest-api/rest-comments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.9/tests/phpunit/tests/rest-api/rest-comments-controller.php 2022-10-17 16:53:54 UTC (rev 54544)
+++ branches/5.9/tests/phpunit/tests/rest-api/rest-comments-controller.php 2022-10-17 17:39:34 UTC (rev 54545)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2972,6 +2972,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$editor_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2980,6 +2981,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => 'div strong',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => 'div strong',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$editor_id,
</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"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2989,6 +2991,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$editor_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2997,6 +3000,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => 'div strong',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => 'div strong',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$editor_id,
</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">@@ -3011,6 +3015,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => '\\\&\\\ & &invalid; < < &lt;',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => '\\\&\\\ & &invalid; < < &lt;',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => '\\\&\\\ & &invalid; < < &lt;',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$superadmin_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3019,6 +3024,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => '\\\&\\\ & &invalid; < < &lt;',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => '\\\&\\\ & &invalid; < < &lt;',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$superadmin_id,
</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">@@ -3032,6 +3038,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$superadmin_id,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3040,6 +3047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_name' => 'div strong',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_user_agent' => 'div strong',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'author' => self::$superadmin_id,
</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>
</div>
</body>
</html>