<!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>[55210] trunk: HTTP API: Fix request header inconsistencies.</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/55210">55210</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/55210","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>audrasjb</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-02-03 13:33:18 +0000 (Fri, 03 Feb 2023)</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'>HTTP API: Fix request header inconsistencies.
This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.
Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes <a href="https://core.trac.wordpress.org/ticket/54225">#54225</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
<li><a href="#trunksrcwpadminincludesupgradephp">trunk/src/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunksrcwpincludesclassjsonphp">trunk/src/wp-includes/class-json.php</a></li>
<li><a href="#trunksrcwpincludesclasssimplepiephp">trunk/src/wp-includes/class-simplepie.php</a></li>
<li><a href="#trunksrcwpincludesclasssnoopyphp">trunk/src/wp-includes/class-snoopy.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunksrcwpincludesrestapiclasswprestrequestphp">trunk/src/wp-includes/rest-api/class-wp-rest-request.php</a></li>
<li><a href="#trunksrcwpincludessitemapsclasswpsitemapsrendererphp">trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php</a></li>
<li><a href="#trunksrcwpincludessitemapsclasswpsitemapsstylesheetphp">trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php</a></li>
<li><a href="#trunksrcwpmailphp">trunk/src/wp-mail.php</a></li>
<li><a href="#trunktestsphpunitdataWPHTTPtestcaseredirectionscriptphp">trunk/tests/phpunit/data/WPHTTP-testcase-redirection-script.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesFilephp">trunk/tests/phpunit/tests/admin/includesFile.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsdoEnclosephp">trunk/tests/phpunit/tests/functions/doEnclose.php</a></li>
<li><a href="#trunktestsphpunittestshttpbasephp">trunk/tests/phpunit/tests/http/base.php</a></li>
<li><a href="#trunktestsphpunittestshttpfunctionsphp">trunk/tests/phpunit/tests/http/functions.php</a></li>
<li><a href="#trunktestsphpunittestspostwpAfterInsertPostphp">trunk/tests/phpunit/tests/post/wpAfterInsertPost.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestautosavescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblockrenderercontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcommentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrequestphp">trunk/tests/phpunit/tests/rest-api/rest-request.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestsettingscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestuserscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-users-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestwidgetscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiwpRestMenuItemsControllerphp">trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php</a></li>
<li><a href="#trunktestsphpunittestswidgetswpWidgetRssphp">trunk/tests/phpunit/tests/widgets/wpWidgetRss.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2532,7 +2532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> check_ajax_referer( 'media-form' );
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * This function does not use wp_send_json_success() / wp_send_json_error()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * as the html4 Plupload handler requires a text/html content-type for older IE.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * as the html4 Plupload handler requires a text/html Content-Type for older IE.
</ins><span class="cx" style="display: block; padding: 0 10px"> * See https://core.trac.wordpress.org/ticket/31037
</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="trunksrcwpadminincludesfilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/file.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-admin/includes/file.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1184,7 +1184,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ), $data );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content_disposition = wp_remote_retrieve_header( $response, 'content-disposition' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content_disposition = wp_remote_retrieve_header( $response, 'Content-Disposition' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $content_disposition ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content_disposition = strtolower( $content_disposition );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1211,7 +1211,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">- $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content_md5 = wp_remote_retrieve_header( $response, 'Content-MD5' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $content_md5 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $md5_check = verify_file_md5( $tmpfname, $content_md5 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1238,7 +1238,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Perform signature valiation if supported.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $signature_verification ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $signature = wp_remote_retrieve_header( $response, 'x-content-signature' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $signature = wp_remote_retrieve_header( $response, 'X-Content-Signature' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $signature ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Retrieve signatures from a file if the header wasn't included.
</span></span></pre></div>
<a id="trunksrcwpadminincludesupgradephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/upgrade.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/upgrade.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-admin/includes/upgrade.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -512,7 +512,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * can block head requests.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_get( $test_url, array( 'timeout' => 5 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $x_pingback_header = wp_remote_retrieve_header( $response, 'x-pingback' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $x_pingback_header = wp_remote_retrieve_header( $response, 'X-Pingback' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $pretty_permalinks = $x_pingback_header && get_bloginfo( 'pingback_url' ) === $x_pingback_header;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $pretty_permalinks ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclassjsonphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-json.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-json.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/class-json.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,7 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- header('Content-type: application/json');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header('Content-Type: application/json');
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->encodeUnsafe($var);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesclasssimplepiephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-simplepie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-simplepie.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/class-simplepie.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1864,7 +1864,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">- * Send the content-type header with correct encoding
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Send the Content-Type header with correct encoding
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This method ensures that the SimplePie-enabled page is being served with
</span><span class="cx" style="display: block; padding: 0 10px"> * the correct {@link http://www.iana.org/assignments/media-types/ mime-type}
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1886,7 +1886,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!headers_sent())
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $header = "Content-type: $mime;";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $header = "Content-Type: $mime;";
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($this->get_encoding())
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> $header .= ' charset=' . $this->get_encoding();
</span></span></pre></div>
<a id="trunksrcwpincludesclasssnoopyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-snoopy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-snoopy.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/class-snoopy.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,7 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $cookies = array(); // array of cookies to pass
</span><span class="cx" style="display: block; padding: 0 10px"> // $cookies["username"]="joe";
</span><span class="cx" style="display: block; padding: 0 10px"> var $rawheaders = array(); // array of raw headers to send
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // $rawheaders["Content-type"]="text/html";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // $rawheaders["Content-Type"]="text/html";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> var $maxredirs = 5; // http redirection depth maximum. 0 = disallow
</span><span class="cx" style="display: block; padding: 0 10px"> var $lastredirectaddr = ""; // contains address of last redirected address
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -825,13 +825,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers .= $headerKey.": ".$headerVal."\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if(!empty($content_type)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers .= "Content-type: $content_type";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers .= "Content-Type: $content_type";
</ins><span class="cx" style="display: block; padding: 0 10px"> if ($content_type == "multipart/form-data")
</span><span class="cx" style="display: block; padding: 0 10px"> $headers .= "; boundary=".$this->_mime_boundary;
</span><span class="cx" style="display: block; padding: 0 10px"> $headers .= "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if(!empty($body))
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers .= "Content-length: ".strlen($body)."\r\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers .= "Content-Length: ".strlen($body)."\r\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> if(!empty($this->user) || !empty($this->pass))
</span><span class="cx" style="display: block; padding: 0 10px"> $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -990,12 +990,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if(!empty($content_type)) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($content_type == "multipart/form-data")
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers[] = "Content-Type: $content_type; boundary=".$this->_mime_boundary;
</ins><span class="cx" style="display: block; padding: 0 10px"> else
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers[] = "Content-type: $content_type";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers[] = "Content-Type: $content_type";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if(!empty($body))
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers[] = "Content-length: ".strlen($body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers[] = "Content-Length: ".strlen($body);
</ins><span class="cx" style="display: block; padding: 0 10px"> if(!empty($this->user) || !empty($this->pass))
</span><span class="cx" style="display: block; padding: 0 10px"> $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/comment.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2824,12 +2824,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_remote_retrieve_header( $response, 'x-pingback' ) ) {
- return wp_remote_retrieve_header( $response, 'x-pingback' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wp_remote_retrieve_header( $response, 'X-Pingback' ) ) {
+ return wp_remote_retrieve_header( $response, 'X-Pingback' );
</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"> // Not an (x)html, sgml, or xml page, no use going further.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( preg_match( '#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( preg_match( '#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'Content-Type' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/functions.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,8 +943,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = wp_get_http_headers( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $headers ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;
- $type = isset( $headers['content-type'] ) ? $headers['content-type'] : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $len = isset( $headers['Content-Length'] ) ? (int) $headers['Content-Length'] : 0;
+ $type = isset( $headers['Content-Type'] ) ? $headers['Content-Type'] : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $allowed_types = array( 'video', 'audio' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check to see if we can figure out the mime type from the extension.
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/general-template.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -755,7 +755,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'admin_email' - Admin email (set in Settings > General)
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'charset' - The "Encoding for pages and feeds" (set in Settings > Reading)
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'version' - The current WordPress version
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * - 'html_type' - The content-type (default: "text/html"). Themes and plugins
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * - 'html_type' - The Content-Type (default: "text/html"). Themes and plugins
</ins><span class="cx" style="display: block; padding: 0 10px"> * can override the default value using the {@see 'pre_option_html_type'} filter
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'text_direction' - The text direction determined by the site's language. is_rtl()
</span><span class="cx" style="display: block; padding: 0 10px"> * should be used instead
</span></span></pre></div>
<a id="trunksrcwpincludespluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/pluggable.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/pluggable.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -463,7 +463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set Content-Type and charset.
</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 we don't have a content-type from the input headers.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If we don't have a Content-Type from the input headers.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $content_type ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content_type = 'text/plain';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiclasswprestrequestphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/class-wp-rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,16 +291,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Retrieves the content-type of the request.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Retrieves the Content-Type of the request.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|null Map containing 'value' and 'parameters' keys
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * or null when no valid content-type header was
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * or null when no valid Content-Type header was
</ins><span class="cx" style="display: block; padding: 0 10px"> * available.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_content_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $value = $this->get_header( 'content-type' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $value = $this->get_header( 'Content-Type' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $value ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,11 +325,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Checks if the request has specified a JSON content-type.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Checks if the request has specified a JSON Content-Type.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.6.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">- * @return bool True if the content-type header is JSON.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True if the Content-Type header is JSON.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function is_json_content_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content_type = $this->get_content_type();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -719,7 +719,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->parsed_body = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Check that we got URL-encoded. Treat a missing content-type as
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Check that we got URL-encoded. Treat a missing Content-Type as
</ins><span class="cx" style="display: block; padding: 0 10px"> * URL-encoded for maximum compatibility.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $content_type = $this->get_content_type();
</span></span></pre></div>
<a id="trunksrcwpincludessitemapsclasswpsitemapsrendererphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,7 +123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $sitemaps Array of sitemap URLs.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function render_index( $sitemaps ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- header( 'Content-type: application/xml; charset=UTF-8' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header( 'Content-Type: application/xml; charset=UTF-8' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_for_simple_xml_availability();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,7 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $url_list Array of URLs for a sitemap.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function render_sitemap( $url_list ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- header( 'Content-type: application/xml; charset=UTF-8' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header( 'Content-Type: application/xml; charset=UTF-8' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_for_simple_xml_availability();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludessitemapsclasswpsitemapsstylesheetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $type Stylesheet type. Either 'sitemap' or 'index'.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function render_stylesheet( $type ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- header( 'Content-type: application/xml; charset=UTF-8' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header( 'Content-Type: application/xml; charset=UTF-8' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'sitemap' === $type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.
</span></span></pre></div>
<a id="trunksrcwpmailphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-mail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-mail.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/src/wp-mail.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = explode( '--' . $boundary, $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = $content[2];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Match case-insensitive content-transfer-encoding.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Match case-insensitive Content-Transfer-Encoding.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = explode( $delim[0], $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = $content[1];
</span></span></pre></div>
<a id="trunktestsphpunitdataWPHTTPtestcaseredirectionscriptphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/WPHTTP-testcase-redirection-script.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/WPHTTP-testcase-redirection-script.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/data/WPHTTP-testcase-redirection-script.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset($_GET['header-check']) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- header("Content-type: text/plain");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header("Content-Type: text/plain");
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $_SERVER as $key => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( stripos($key, 'http') === 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $key = strtolower(substr($key, 5));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo $method;
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['location-with-200'] ) ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesFilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesFile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesFile.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/admin/includesFile.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'attachment; filename="filename-from-content-disposition-header.txt"',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'attachment; filename="filename-from-content-disposition-header.txt"',
</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">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'attachment; filename="../../filename-from-content-disposition-header.txt"',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'attachment; filename="../../filename-from-content-disposition-header.txt"',
</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">@@ -192,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'attachment; filename=filename-from-content-disposition-header.txt',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'attachment; filename=filename-from-content-disposition-header.txt',
</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">@@ -241,7 +241,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'filename="filename-from-content-disposition-header.txt"',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'filename="filename-from-content-disposition-header.txt"',
</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">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'inline; filename="filename-from-content-disposition-header.txt"',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'inline; filename="filename-from-content-disposition-header.txt"',
</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">@@ -277,7 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 200,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-disposition' => 'form-data; name="file"; filename="filename-from-content-disposition-header.txt"',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Disposition' => 'form-data; name="file"; filename="filename-from-content-disposition-header.txt"',
</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="trunktestsphpunittestsfunctionsdoEnclosephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/functions/doEnclose.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/doEnclose.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/functions/doEnclose.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,8 +265,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fake_headers = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'mp4' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-length' => 123,
- 'content-type' => 'video/mp4',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Length' => 123,
+ 'Content-Type' => 'video/mp4',
</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"> 'ogg' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,8 +289,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fallback header.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-length' => 0,
- 'content-type' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Length' => 0,
+ 'Content-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></span></pre></div>
<a id="trunktestsphpunittestshttpbasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/http/base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/base.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/http/base.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,7 +283,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( '', $res['body'] ); // The body should be empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEquals( $size, $res['headers']['Content-Length'] ); // Check the headers are returned (and the size is the same).
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringStartsWith( get_temp_dir(), $res['filename'] ); // Check it's saving within the temp directory.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshttpfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/http/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/functions.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/http/functions.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,8 +20,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIsArray( $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( 'image/jpeg', $headers['content-type'] );
- $this->assertSame( '40148', $headers['content-length'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
+ $this->assertSame( '40148', $headers['Content-Length'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</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">@@ -65,8 +65,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIsArray( $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return the same headers as a HEAD request.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( 'image/jpeg', $headers['content-type'] );
- $this->assertSame( '40148', $headers['content-length'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
+ $this->assertSame( '40148', $headers['Content-Length'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</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">@@ -86,8 +86,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = wp_remote_retrieve_headers( $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return the same headers as a HEAD request.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( 'image/jpeg', $headers['content-type'] );
- $this->assertSame( '40148', $headers['content-length'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['Content-Type'] );
+ $this->assertSame( '40148', $headers['Content-Length'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</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="trunktestsphpunittestspostwpAfterInsertPostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/post/wpAfterInsertPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/wpAfterInsertPost.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/post/wpAfterInsertPost.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::$post_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'title' => 'new title' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,7 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', sprintf( '/wp/v2/posts' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'new title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = self::$attachment_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/media/%d', $attachment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'title' => 'new attachment title' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestautosavescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,7 +311,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,7 +327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,7 +346,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$contributor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,7 +365,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_post = get_post( self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $autosave_data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,7 +451,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $autosave_data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,7 +572,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_draft_page_with_parent() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$child_draft_page_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -593,7 +593,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$draft_page_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,7 +648,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Initiate an autosave via the REST API as Gutenberg does.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $autosave_data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -699,7 +699,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create autosaves response.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . $post_id . '/autosaves' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $autosave_data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblockrenderercontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -501,7 +501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attributes = array( 'some_string' => $string_attribute );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', self::$rest_api_route . self::$block_name );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->set_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->set_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( compact( 'attributes' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestcommentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/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">--- trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1133,7 +1133,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1239,7 +1239,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1264,7 +1264,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1287,7 +1287,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1307,7 +1307,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1327,7 +1327,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1347,7 +1347,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1365,7 +1365,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1386,7 +1386,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1413,7 +1413,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1435,7 +1435,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1460,7 +1460,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1481,7 +1481,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1510,7 +1510,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 201, $response->get_status() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1536,7 +1536,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1575,7 +1575,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1598,7 +1598,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1625,7 +1625,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1654,7 +1654,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1679,7 +1679,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1699,7 +1699,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1720,7 +1720,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1744,7 +1744,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1768,8 +1768,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
- $request->add_header( 'user_agent', 'Mozilla/4.0 (compatible; MSIE 5.5; AOL 4.0; Windows 95)' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
+ $request->add_header( 'User_Agent', 'Mozilla/4.0 (compatible; MSIE 5.5; AOL 4.0; Windows 95)' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1794,7 +1794,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'approved',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1815,7 +1815,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'approved',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1835,7 +1835,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_comment_invalid_author_ip', $response, 403 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1855,7 +1855,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1875,7 +1875,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1895,7 +1895,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1915,7 +1915,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1935,7 +1935,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1955,7 +1955,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1976,7 +1976,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1996,7 +1996,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2023,7 +2023,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2044,7 +2044,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2075,7 +2075,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2093,7 +2093,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2117,7 +2117,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2132,7 +2132,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2156,7 +2156,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2183,7 +2183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2207,7 +2207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2231,7 +2231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2255,7 +2255,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2275,7 +2275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2296,7 +2296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 201, $response->get_status() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2319,7 +2319,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2424,7 +2424,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', $comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2452,7 +2452,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', $comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2474,7 +2474,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2498,7 +2498,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2518,7 +2518,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2537,7 +2537,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2557,7 +2557,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2575,7 +2575,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2592,7 +2592,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2609,7 +2609,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2630,7 +2630,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2646,7 +2646,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2661,7 +2661,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"> $request = new WP_REST_Request( 'PUT', '/wp/v2/comments/' . REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2686,7 +2686,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$hold_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2705,7 +2705,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2735,7 +2735,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', $private_comment_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2794,7 +2794,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2814,7 +2814,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2834,7 +2834,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2853,7 +2853,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2874,7 +2874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestrequestphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-request.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-request.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,7 +203,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider alternate_json_content_type_provider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $content_type The content-type header.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $content_type The Content-Type header.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $source The source value.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $accept_json The accept_json value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +234,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider is_json_content_type_provider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $content_type The content-type header.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $content_type The Content-Type header.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $is_json The is_json value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_is_json_content_type( $content_type, $is_json ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_header( 'Content-Type', $content_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check for JSON content-type.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check for JSON Content-Type.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $is_json, $this->request->is_json_content_type() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,7 +361,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"> $this->request->set_method( 'PUT' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( wp_json_encode( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $key => $expected_value ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,7 +383,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"> $this->request->set_method( 'POST' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( wp_json_encode( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $key => $expected_value ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -864,7 +864,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_follows_parameter_order() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_json_encode(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -892,7 +892,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_updates_param_in_json_and_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_json_encode(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -919,7 +919,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_updates_param_if_already_exists_in_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_json_encode(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -953,7 +953,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_to_null_updates_param_in_json_and_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_json_encode(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -980,7 +980,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_from_null_updates_param_in_json_and_query_with_null() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_json_encode(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1007,7 +1007,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_with_invalid_json() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_method( 'POST' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'value' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestsettingscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,7 +773,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"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestuserscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-users-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-users-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-users-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1230,7 +1230,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1263,7 +1263,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1308,7 +1308,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1338,7 +1338,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1369,7 +1369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'can_add_user_to_blog', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'user_cannot_be_added', $response );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1392,7 +1392,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( self::$site );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1422,7 +1422,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1431,7 +1431,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( self::$site );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $switched_response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1470,7 +1470,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1487,7 +1487,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1507,7 +1507,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1526,7 +1526,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1546,7 +1546,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"> $request = new WP_REST_Request( 'POST', '/wp/v2/users' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1579,7 +1579,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['locale'] = 'de_DE';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', $user_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $_POST );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1826,7 +1826,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $pw_before = $userdata->user_pass;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', $user_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/json' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/json' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2008,7 +2008,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', self::$user ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2015,7 +2015,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_cannot_edit', $response, 403 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/users/me' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2035,7 +2035,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"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', self::$editor ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2892,7 +2892,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', $user_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'first_name' => 'New Name' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_user_invalid_id', $response, 404 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2914,7 +2914,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$superadmin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', $user_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'first_name' => 'New Name' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_user_invalid_id', $response, 404 );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestwidgetscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function mocked_rss_response() {
</span><span class="cx" style="display: block; padding: 0 10px"> $single_value_headers = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-type' => 'application/rss+xml; charset=UTF-8',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Type' => 'application/rss+xml; charset=UTF-8',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'link' => '<https://wordpress.org/news/wp-json/>; rel="https://api.w.org/"',
</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="trunktestsphpunittestsrestapiwpRestMenuItemsControllerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +318,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menus' => array( 123, 456 ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,7 +354,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'taxonomy',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = array();
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 1; $i < 5; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_order' => $i,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_menu_id = wp_create_nav_menu( rand_str() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_order' => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_order' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,7 +436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_menu_id = wp_create_nav_menu( rand_str() );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_order' => 'ddddd',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,7 +456,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_menu_id = wp_create_nav_menu( rand_str() );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_order' => -9,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -476,7 +476,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_create_nav_menu( rand_str() );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => -9,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -494,7 +494,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_invalid_menu() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'menus' => -9,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -513,7 +513,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'post_type',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -533,7 +533,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'post_type_archive',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -553,7 +553,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'custom',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -573,7 +573,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'custom',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -593,7 +593,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'custom',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -615,7 +615,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/menu-items/%d', $this->menu_item_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'xfn' => array( 'test1', 'test2', 'test3' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,7 +648,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $good_data = array( 'test1', 'test2', 'test3', 'test4' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/menu-items/%d', $this->menu_item_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'xfn' => $bad_data,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -680,7 +680,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/menu-items/%d', $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1021,7 +1021,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/menu-items' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $parameters = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Some \\\'title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1043,7 +1043,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/menu-items/%d', $this->menu_item_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = 'Some \\\'title';
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_menu_item_data(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetswpWidgetRssphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/widgets/wpWidgetRss.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/wpWidgetRss.php 2023-02-03 12:46:18 UTC (rev 55209)
+++ trunk/tests/phpunit/tests/widgets/wpWidgetRss.php 2023-02-03 13:33:18 UTC (rev 55210)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function mocked_rss_response() {
</span><span class="cx" style="display: block; padding: 0 10px"> $single_value_headers = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'content-type' => 'application/rss+xml; charset=UTF-8',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Content-Type' => 'application/rss+xml; charset=UTF-8',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'link' => '<https://wordpress.org/news/wp-json/>; rel="https://api.w.org/"',
</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>