<!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>[54571] branches/5.0: Grouped backports to the 5.0 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/54571">54571</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/54571","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>2022-10-17 18:13:25 +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.0 branch.

- 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,
- Media: Refactor search by filename within the admin,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Comments: Apply kses when editing comments,
- Customize: Escape blogname option in underscores templates,
- REST API: Lockdown post parameter of the terms endpoint,
- Mail: Reset PHPMailer properties between use,
- Query: Validate relation in `WP_Date_Query`,
- Widgets: Escape RSS error messages for display.

Merges <a href="https://core.trac.wordpress.org/changeset/54521">[54521]</a>, <a href="https://core.trac.wordpress.org/changeset/54522">[54522]</a>, <a href="https://core.trac.wordpress.org/changeset/54523">[54523]</a>, <a href="https://core.trac.wordpress.org/changeset/54524">[54524]</a>, <a href="https://core.trac.wordpress.org/changeset/54525">[54525]</a>, <a href="https://core.trac.wordpress.org/changeset/54526">[54526]</a>, <a href="https://core.trac.wordpress.org/changeset/54527">[54527]</a>, <a href="https://core.trac.wordpress.org/changeset/54528">[54528]</a>, <a href="https://core.trac.wordpress.org/changeset/54529">[54529]</a>, <a href="https://core.trac.wordpress.org/changeset/54530">[54530]</a>, <a href="https://core.trac.wordpress.org/changeset/54541">[54541]</a> to the 5.0 branch.
Props voldemortensen, johnbillion, paulkevan, peterwilsoncc, xknown, dd32, audrasjb, martinkrcho, vortfu, davidbaumwald, tykoted, timothyblynjacobs, johnjamesjacoby, ehtis, matveb, talldanwp.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branches50srcwpadminincludesajaxactionsphp">branches/5.0/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#branches50srcwpadminincludespostphp">branches/5.0/src/wp-admin/includes/post.php</a></li>
<li><a href="#branches50srcwpincludesclasswpqueryphp">branches/5.0/src/wp-includes/class-wp-query.php</a></li>
<li><a href="#branches50srcwpincludescommentphp">branches/5.0/src/wp-includes/comment.php</a></li>
<li><a href="#branches50srcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp">branches/5.0/src/wp-includes/customize/class-wp-customize-header-image-control.php</a></li>
<li><a href="#branches50srcwpincludescustomizeclasswpcustomizesiteiconcontrolphp">branches/5.0/src/wp-includes/customize/class-wp-customize-site-icon-control.php</a></li>
<li><a href="#branches50srcwpincludesdatephp">branches/5.0/src/wp-includes/date.php</a></li>
<li><a href="#branches50srcwpincludesdeprecatedphp">branches/5.0/src/wp-includes/deprecated.php</a></li>
<li><a href="#branches50srcwpincludesfunctionsphp">branches/5.0/src/wp-includes/functions.php</a></li>
<li><a href="#branches50srcwpincludesmediatemplatephp">branches/5.0/src/wp-includes/media-template.php</a></li>
<li><a href="#branches50srcwpincludespluggablephp">branches/5.0/src/wp-includes/pluggable.php</a></li>
<li><a href="#branches50srcwpincludespostphp">branches/5.0/src/wp-includes/post.php</a></li>
<li><a href="#branches50srcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp">branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</a></li>
<li><a href="#branches50srcwpincludesrestapiendpointsclasswpresttermscontrollerphp">branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php</a></li>
<li><a href="#branches50srcwpincludeswidgetsphp">branches/5.0/src/wp-includes/widgets.php</a></li>
<li><a href="#branches50srcwpmailphp">branches/5.0/src/wp-mail.php</a></li>
<li><a href="#branches50srcwptrackbackphp">branches/5.0/src/wp-trackback.php</a></li>
<li><a href="#branches50testsphpunittestsquerysearchphp">branches/5.0/tests/phpunit/tests/query/search.php</a></li>
<li><a href="#branches50testsphpunittestsrestapirestcommentscontrollerphp">branches/5.0/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#branches50">branches/5.0/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/5.0
</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.0 2022-10-17 18:11:58 UTC (rev 54570)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/5.0  2022-10-17 18:13:25 UTC (rev 54571)
</ins><a id="branches50"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/5.0</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/4.8:42204
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.9:43557,43622,44991
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.5:49373-49379,49381
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk:42132,42134,42136,42138,42140,42144,42146,42148,42150,42152-42153,42155,42157,42159,42161,42163,42169,42171,42173,42175,42177,42181,42183,42185,42187,42189,42191,42193,42199,42203,42210,42214,42220,42222,42226,42242,42244,42247,42250-42251,42256-42261,42350,42354,42358,42362,42364-42368,42374,42388,42390,42401,42405,42417,42421,42423-42425,42430,42432-42433,42437,42441,42443-42444,42446-42447,42449,42451,42453,42457,42459,42462,42491,42521,42529,42531,42533,42536,42538,42541,42543,42545,42549,42566,42568,42570,42572,42574,42576,42579,42581-42582,42584-42585,42587-42588,42590,42592,42594-42595,42598-42599,42602,42604,42606,42611-42613,42615,42617,42624-42625,42639,42642,42648,42652-42653,42665,42676,42687,42695,42697,42701-42702,42711,42713,42719,42722,42726,42728,42733,42739-42740,42744,42758,42772,42791-42792,42801,42807,42812,42814-42815,42817-42819,42823,42830,42837,42839,42841
 ,42844,42851-42852,42860,42862,42864,42878-42879,42881,42888-42889,42892-42894,42930,42964-42965,42967,42971-42972,42977-42978,42980-42982,42985-42987,42989,42992,42994-42995,42998-42999,43001-43004,43007-43008,43011-43012,43014-43015,43025,43027,43030,43032,43034,43036,43039,43042,43044-43049,43051-43063,43065,43081,43085,43087-43089,43091,43104,43116,43118,43120-43121,43123,43125-43126,43131-43132,43135,43137,43139,43145-43148,43150,43154-43155,43158,43160,43162,43166,43168,43170,43172,43175,43180-43181,43183-43185,43189,43191,43193,43195,43197,43199,43201,43203,43206,43208,43210-43212,43216,43218,43220,43222-43223,43226,43228,43230,43232,43234,43236,43238,43242-43243,43245-43246,43248-43251,43256,43259-43260,43263,43265,43267,43269,43274-43275,43278-43279,43282,43284,43286,43290,43293,43299,43303-43304,43313,43315,43317,43331,43337,43343,43350,43353,43356,43361-43363,43365,43367,43370-43371,43373-43376,43379,43388,43390,43435,43437,43439-43440,43446-43447,43451,43454,43457,43460,
 43462-43467,43469,43471,43475,43477-43478,43480,43486,43491,43493,43495,43499,43504,43506,43508,43511-43513,43518,43525,43527,43529,43531,43541,43550,43559,43561,43565,43567,43574,43578,43580,43584-43586,43589,43593,43597,43599,43601,43604-43605,43609,43636,43638,43645,43647,43653,43658-43659,43664,43673,44021,44048,44233,44322,44338,44368-44371,44376-44382,44389,44391,44398-44399,44402-44403,44406,44408,44418,44432,44435,44437-44439,44441-44442,44728,44833,44842,44993,45067,45321,45745,45762,45765,45783-45784,45800,45819,45826,45885,45936,45971,45990,45997,46320,46403-46404,46408-46409,46474-46478,46483,46485,46682,46893-46896,46996,46999,47225,47341,47404,47633-47638,47867-47869,47872-47873,47912,47948-47951,47984,48121,48241,48338,48341,48705,49162,49168-49169,49175,49204,49227-49228,49244,49335,49358,49360,49362,49369,49371,49380,49382-49388,49548,49636,49781-49784,49786,49836,49876,49933,49937-49940,49983,49989,50017,50126,50176,50185,50192,50267-50268,50285,50298,50379,50387,5
 0413,50416,50432,50435-50436,50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50598,50704,50717,50796,50799,50930,50940-50941,50984-50985,51341,51355,51426,51498,51511,51535,51921,51924-51925,51937,52002,52130,52183,52233,52412,52454-52457,52844,53112,53581-53582,53592,53958-53960,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:42132,42134,42136,42138,42140,42144,42146,42148,42150,42152-42153,42155,42157,42159,42161,42163,42169,42171,42173,42175,42177,42181,42183,42185,42187,42189,42191,42193,42199,42203,42210,42214,42220,42222,42226,42242,42244,42247,42250-42251,42256-42261,42350,42354,42358,42362,42364-42368,42374,42388,42390,42401,42405,42417,42421,42423-42425,42430,42432-42433,42437,42441,42443-42444,42446-42447,42449,42451,42453,42457,42459,42462,42491,42521,42529,42531,42533,42536,42538,42541,42543,42545,42549,42566,42568,42570,42572,42574,42576,42579,42581-42582,42584-42585,42587-42588,42590,42592,42594-42595,42598-42599,42602,42604,42606,42611-42613,42615,42617,42624-42625,42639,42642,42648,42652-42653,42665,42676,42687,42695,42697,42701-42702,42711,42713,42719,42722,42726,42728,42733,42739-42740,42744,42758,42772,42791-42792,42801,42807,42812,42814-42815,42817-42819,42823,42830,42837,42839,42841
 ,42844,42851-42852,42860,42862,42864,42878-42879,42881,42888-42889,42892-42894,42930,42964-42965,42967,42971-42972,42977-42978,42980-42982,42985-42987,42989,42992,42994-42995,42998-42999,43001-43004,43007-43008,43011-43012,43014-43015,43025,43027,43030,43032,43034,43036,43039,43042,43044-43049,43051-43063,43065,43081,43085,43087-43089,43091,43104,43116,43118,43120-43121,43123,43125-43126,43131-43132,43135,43137,43139,43145-43148,43150,43154-43155,43158,43160,43162,43166,43168,43170,43172,43175,43180-43181,43183-43185,43189,43191,43193,43195,43197,43199,43201,43203,43206,43208,43210-43212,43216,43218,43220,43222-43223,43226,43228,43230,43232,43234,43236,43238,43242-43243,43245-43246,43248-43251,43256,43259-43260,43263,43265,43267,43269,43274-43275,43278-43279,43282,43284,43286,43290,43293,43299,43303-43304,43313,43315,43317,43331,43337,43343,43350,43353,43356,43361-43363,43365,43367,43370-43371,43373-43376,43379,43388,43390,43435,43437,43439-43440,43446-43447,43451,43454,43457,43460,
 43462-43467,43469,43471,43475,43477-43478,43480,43486,43491,43493,43495,43499,43504,43506,43508,43511-43513,43518,43525,43527,43529,43531,43541,43550,43559,43561,43565,43567,43574,43578,43580,43584-43586,43589,43593,43597,43599,43601,43604-43605,43609,43636,43638,43645,43647,43653,43658-43659,43664,43673,44021,44048,44233,44322,44338,44368-44371,44376-44382,44389,44391,44398-44399,44402-44403,44406,44408,44418,44432,44435,44437-44439,44441-44442,44728,44833,44842,44993,45067,45321,45745,45762,45765,45783-45784,45800,45819,45826,45885,45936,45971,45990,45997,46320,46403-46404,46408-46409,46474-46478,46483,46485,46682,46893-46896,46996,46999,47225,47341,47404,47633-47638,47867-47869,47872-47873,47912,47948-47951,47984,48121,48241,48338,48341,48705,49162,49168-49169,49175,49204,49227-49228,49244,49335,49358,49360,49362,49369,49371,49380,49382-49388,49548,49636,49781-49784,49786,49836,49876,49933,49937-49940,49983,49989,50017,50126,50176,50185,50192,50267-50268,50285,50298,50379,50387,5
 0413,50416,50432,50435-50436,50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50598,50704,50717,50796,50799,50930,50940-50941,50984-50985,51341,51355,51426,51498,51511,51535,51921,51924-51925,51937,52002,52130,52183,52233,52412,52454-52457,52844,53112,53581-53582,53592,53958-53960,54322,54521-54530,54541
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches50srcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-admin/includes/ajax-actions.php       2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-admin/includes/ajax-actions.php 2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2469,7 +2469,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="branches50srcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-admin/includes/post.php       2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-admin/includes/post.php 2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1180,7 +1180,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="branches50srcwpincludesclasswpqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-includes/class-wp-query.php   2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/class-wp-query.php     2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,6 +438,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        private $compat_methods = array( 'init_query_flags', 'parse_tax_query' );
</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">          * Resets query flags to false.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * The query flags are what page info WordPress was able to figure out.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1298,7 +1305,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">@@ -1634,6 +1646,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">@@ -2038,7 +2060,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">@@ -2111,6 +2133,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="branches50srcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/comment.php  2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/comment.php    2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2183,6 +2183,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return 0;
</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">@@ -2193,6 +2202,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="branches50srcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-includes/customize/class-wp-customize-header-image-control.php        2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/customize/class-wp-customize-header-image-control.php  2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,10 +103,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></pre></div>
<a id="branches50srcwpincludescustomizeclasswpcustomizesiteiconcontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-includes/customize/class-wp-customize-site-icon-control.php   2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/customize/class-wp-customize-site-icon-control.php     2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,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"><?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"><?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="branches50srcwpincludesdatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/date.php     2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/date.php       2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,8 +145,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *                              'comment_date', 'comment_date_gmt'.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct( $date_query, $default_column = 'post_date' ) {
</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">@@ -225,6 +225,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">@@ -998,4 +1001,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="branches50srcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/deprecated.php       2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/deprecated.php 2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3952,3 +3952,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">                wp_send_json_error( array( 'errorMessage' => __( 'The Press This plugin is required.' ) ) );
</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 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="branches50srcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/functions.php        2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/functions.php  2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -656,11 +656,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Determines whether the publish date of the current post in the loop is different
</span><span class="cx" style="display: block; padding: 0 10px">  * from the publish date of the previous post in the loop.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @global string $currentday  The day of the current post in the loop.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1351,9 +1351,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * cache, and the database goes away, then you might have problems.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Checks for the 'siteurl' option for whether WordPress is installed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 2.1.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2412,7 +2412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $type !== $real_mime ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                /*
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                 * Everything else including image/* and application/*: 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                          * Everything else including image/* and application/*:
</ins><span class="cx" style="display: block; padding: 0 10px">                                  * If the real content type doesn't match the file extension, assume it's dangerous.
</span><span class="cx" style="display: block; padding: 0 10px">                                 */
</span><span class="cx" style="display: block; padding: 0 10px">                                $type = $ext = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2421,7 +2421,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">-        // The mime type must be allowed 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // The mime type must be allowed
</ins><span class="cx" style="display: block; padding: 0 10px">         if ( $type ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $allowed = get_allowed_mime_types();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2695,9 +2695,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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $html .= '</p><p>';
-                       $html .= sprintf( '<a href="%s">%s</a>',
-                               esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
</del><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 ) );
+                       $html           .= '</p><p>';
+                       $html           .= sprintf(
+                               '<a href="%s">%s</a>',
+                               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="branches50srcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/media-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/media-template.php   2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/media-template.php     2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1251,7 +1251,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"><?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"><?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="branches50srcwpincludespluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/pluggable.php        2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/pluggable.php  2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,6 +312,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">        // From email and name
</span><span class="cx" style="display: block; padding: 0 10px">        // If we don't have a name from the input headers
</span></span></pre></div>
<a id="branches50srcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/post.php     2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/post.php       2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1018,9 +1018,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">  * Determines whether a post type is registered.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1778,10 +1778,102 @@
</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">-        return $post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_object( $post_type ) ) {
+               return false;
+       }
+
+       $is_viewable = $post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public );
+
+       /**
+        * Filters whether a post type is considered "viewable".
+        *
+        * The returned filtered value must be a boolean type to ensure
+        * `is_post_type_viewable()` only returns a boolean. This strictness
+        * is by design to maintain backwards-compatibility and guard against
+        * potential type errors in PHP 8.1+. Non-boolean values (even falsey
+        * and truthy values) will result in the function returning false.
+        *
+        * @since 5.9.0
+        *
+        * @param bool         $is_viewable Whether the post type is "viewable" (strict type).
+        * @param WP_Post_Type $post_type   Post type object.
+        */
+       return true === apply_filters( 'is_post_type_viewable', $is_viewable, $post_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"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Determines whether a post status is considered "viewable".
+ *
+ * For built-in post statuses such as publish and private, the 'public' value will be evaluated.
+ * For all others, the 'publicly_queryable' value will be used.
+ *
+ * @since 5.7.0
+ * @since 5.9.0 Added `is_post_status_viewable` hook to filter the result.
+ *
+ * @param string|stdClass $post_status Post status name or object.
+ * @return bool Whether the post status should be considered viewable.
+ */
+function is_post_status_viewable( $post_status ) {
+       if ( is_scalar( $post_status ) ) {
+               $post_status = get_post_status_object( $post_status );
+
+               if ( ! $post_status ) {
+                       return false;
+               }
+       }
+
+       if (
+               ! is_object( $post_status ) ||
+               $post_status->internal ||
+               $post_status->protected
+       ) {
+               return false;
+       }
+
+       $is_viewable = $post_status->publicly_queryable || ( $post_status->_builtin && $post_status->public );
+
+       /**
+        * Filters whether a post status is considered "viewable".
+        *
+        * The returned filtered value must be a boolean type to ensure
+        * `is_post_status_viewable()` only returns a boolean. This strictness
+        * is by design to maintain backwards-compatibility and guard against
+        * potential type errors in PHP 8.1+. Non-boolean values (even falsey
+        * and truthy values) will result in the function returning false.
+        *
+        * @since 5.9.0
+        *
+        * @param bool     $is_viewable Whether the post status is "viewable" (strict type).
+        * @param stdClass $post_status Post status object.
+        */
+       return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status );
+}
+
+/**
+ * Determines whether a post is publicly viewable.
+ *
+ * Posts are considered publicly viewable if both the post status and post type
+ * are viewable.
+ *
+ * @since 5.7.0
+ *
+ * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.
+ * @return bool Whether the post is publicly viewable.
+ */
+function is_post_publicly_viewable( $post = null ) {
+       $post = get_post( $post );
+
+       if ( ! $post ) {
+               return false;
+       }
+
+       $post_type   = get_post_type( $post );
+       $post_status = get_post_status( $post );
+
+       return is_post_type_viewable( $post_type ) && is_post_status_viewable( $post_status );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Retrieve list of latest posts or posts matching criteria.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * The defaults are as follows:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2044,11 +2136,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Sticky posts should remain at the top of The Loop. If the post ID is not
</span><span class="cx" style="display: block; padding: 0 10px">  * given, then The Loop ID for the current post will be used.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * @since 2.7.0
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param int $post_id Optional. Post ID. Default is ID of the global $post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5026,11 +5118,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">  * Determines whether an attachment URI is local and really an attachment.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * @since 2.0.0
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @param string $url URL to check
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5527,9 +5619,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">  * Determines whether an attachment is an image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * For more information on this and similar theme functions, check out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
</ins><span class="cx" style="display: block; padding: 0 10px">  * Conditional Tags} article in the Theme Developer Handbook.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 2.1.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6539,35 +6631,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">- * Filter the SQL clauses of an attachment query to include filenames.
- *
- * @since 4.7.0
- * @access private
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
- *                       DISTINCT, fields (SELECT), and LIMITS clauses.
- * @return array The modified 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="branches50srcwpincludesrestapiendpointsclasswprestattachmentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php  2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php    2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,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="branches50srcwpincludesrestapiendpointsclasswpresttermscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php        2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php  2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,6 +127,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">@@ -136,12 +165,43 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function get_items_permissions_check( $request ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $tax_obj = get_taxonomy( $this->taxonomy );
</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 ( ! $tax_obj || ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {
</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">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 return new WP_Error(
+                               'rest_forbidden_context',
+                               __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ),
+                               array( 'status' => rest_authorization_required_code() )
+                       );
</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 ( ! 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="branches50srcwpincludeswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-includes/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-includes/widgets.php  2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-includes/widgets.php    2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1408,7 +1408,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">                 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">@@ -1517,7 +1517,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="branches50srcwpmailphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-mail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-mail.php      2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-mail.php        2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,6 +60,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        wp_die( __('There doesn&#8217;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">@@ -124,11 +127,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $author = trim($line);
</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: 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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                $post_author = $userdata->ID;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         $post_author  = $userdata->ID;
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 $author_found = 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="branches50srcwptrackbackphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/src/wp-trackback.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/src/wp-trackback.php 2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/src/wp-trackback.php   2022-10-17 18:13:25 UTC (rev 54571)
</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="branches50testsphpunittestsquerysearchphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/tests/phpunit/tests/query/search.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/5.0/tests/phpunit/tests/query/search.php 2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/tests/phpunit/tests/query/search.php   2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,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( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,7 +396,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( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,7 +447,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( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,7 +483,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( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,22 +506,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', array(
-                       'where'    => '',
-                       'groupby'  => '',
-                       'join'     => '',
-                       'orderby'  => '',
-                       'distinct' => '',
-                       'fields'   => '',
-                       'limit'    => '',
-               ) );
</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' );
</ins><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">+         $q = new WP_Query(
+                       array(
+                               's'           => 'image1',
+                               'fields'      => 'ids',
+                               'post_type'   => 'attachment',
+                               'post_status' => 'inherit',
+                       )
+               );
</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">+         $this->assertSame( array( $attachment ), $q->posts );
+
+               /*
+                * 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="branches50testsphpunittestsrestapirestcommentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/5.0/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.0/tests/phpunit/tests/rest-api/rest-comments-controller.php    2022-10-17 18:11:58 UTC (rev 54570)
+++ branches/5.0/tests/phpunit/tests/rest-api/rest-comments-controller.php      2022-10-17 18:13:25 UTC (rev 54571)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2604,6 +2604,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">                         ), array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'content' => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'raw'      => 'div <strong>strong</strong> oh noes',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2611,6 +2612,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">                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->assertTrue( current_user_can( 'unfiltered_html' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2618,6 +2620,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">                         ), array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'content' => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'raw'      => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2625,6 +2628,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">@@ -2636,6 +2640,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'content'           => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
</span><span class="cx" style="display: block; padding: 0 10px">                        'author_name'       => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
</span><span class="cx" style="display: block; padding: 0 10px">                        'author_user_agent' => '\\\&\\\ &amp; &invalid; < &lt; &amp;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">                 ), array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'content' => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'raw'      => '\\\&\\\ &amp; &invalid; < &lt; &amp;lt;',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2643,6 +2648,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'author_name'       => '\\\&amp;\\\ &amp; &amp;invalid; &lt; &lt; &amp;lt;',
</span><span class="cx" style="display: block; padding: 0 10px">                        'author_user_agent' => '\\\&\\\ &amp; &invalid; &lt; &lt; &amp;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">@@ -2653,6 +2659,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">                 ), array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'content' => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'raw'      => '<div>div</div> <strong>strong</strong> <script>oh noes</script>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2660,6 +2667,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>