<!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>[56192] trunk/src/wp-includes: Docs: Replace multiple single line comments with multi-line comments.</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/56192">56192</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/56192","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-07-10 22:46:22 +0000 (Mon, 10 Jul 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'>Docs: Replace multiple single line comments with multi-line comments.
This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/<a href="https://core.trac.wordpress.org/ticket/5">#5</a>-inline-comments.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/56174">[56174]</a>, <a href="https://core.trac.wordpress.org/changeset/56175">[56175]</a>, <a href="https://core.trac.wordpress.org/changeset/56176">[56176]</a>, <a href="https://core.trac.wordpress.org/changeset/56177">[56177]</a>, <a href="https://core.trac.wordpress.org/changeset/56178">[56178]</a>, <a href="https://core.trac.wordpress.org/changeset/56179">[56179]</a>, <a href="https://core.trac.wordpress.org/changeset/56180">[56180]</a>, <a href="https://core.trac.wordpress.org/changeset/56191">[56191]</a>.
Props costdev, audrasjb.
See <a href="https://core.trac.wordpress.org/ticket/58459">#58459</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesmsdefaultconstantsphp">trunk/src/wp-includes/ms-default-constants.php</a></li>
<li><a href="#trunksrcwpincludesmsfunctionsphp">trunk/src/wp-includes/ms-functions.php</a></li>
<li><a href="#trunksrcwpincludesmsloadphp">trunk/src/wp-includes/ms-load.php</a></li>
<li><a href="#trunksrcwpincludesmssitephp">trunk/src/wp-includes/ms-site.php</a></li>
<li><a href="#trunksrcwpincludesnavmenuphp">trunk/src/wp-includes/nav-menu.php</a></li>
<li><a href="#trunksrcwpincludesoptionphp">trunk/src/wp-includes/option.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesqueryphp">trunk/src/wp-includes/query.php</a></li>
<li><a href="#trunksrcwpincludesrestapiphp">trunk/src/wp-includes/rest-api.php</a></li>
<li><a href="#trunksrcwpincludesrevisionphp">trunk/src/wp-includes/revision.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesmsdefaultconstantsphp"></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/ms-default-constants.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-default-constants.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/ms-default-constants.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,8 +28,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
</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">- // Note, the main site in a post-MU network uses wp-content/uploads.
- // This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Note, the main site in a post-MU network uses wp-content/uploads.
+ * This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'UPLOADS' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $site_id = get_current_blog_id();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesmsfunctionsphp"></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/ms-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-functions.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/ms-functions.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,8 +245,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign );
</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 being removed from the primary blog, set a new primary
- // if the user is assigned to multiple blogs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If being removed from the primary blog, set a new primary
+ * if the user is assigned to multiple blogs.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $primary_blog = get_user_meta( $user_id, 'primary_blog', true );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $primary_blog == $blog_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $new_id = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -717,8 +719,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Has someone already signed up for this domain?
- // TODO: Check email too?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Has someone already signed up for this domain?
+ * TODO: Check email too?
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $signup instanceof stdClass ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $diff = time() - mysql2date( 'U', $signup->registered );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1939,8 +1943,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_blogs = get_blogs_of_user( (int) $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $most_recent_post = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Walk through each blog and get the most recent post
- // published by $user_id.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Walk through each blog and get the most recent post
+ * published by $user_id.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $user_blogs as $blog ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $recent_post = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A );
</span></span></pre></div>
<a id="trunksrcwpincludesmsloadphp"></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/ms-load.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-load.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/ms-load.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,8 +226,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * then cache whether we can just always ignore paths.
</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">- // Either www or non-www is supported, not both. If a www domain is requested,
- // query for both to provide the proper redirect.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Either www or non-www is supported, not both. If a www domain is requested,
+ * query for both to provide the proper redirect.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $domains = array( $domain );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( str_starts_with( $domain, 'www.' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $domains[] = substr( $domain, 4 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,8 +312,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strcasecmp( $current_site->domain, $domain ) && 0 === strcasecmp( $current_site->path, $path ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_blog = get_site_by_path( $domain, $path );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( '/' !== $current_site->path && 0 === strcasecmp( $current_site->domain, $domain ) && 0 === stripos( $path, $current_site->path ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If the current network has a path and also matches the domain and path of the request,
- // we need to look for a site using the first path segment following the network's path.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If the current network has a path and also matches the domain and path of the request,
+ * we need to look for a site using the first path segment following the network's path.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_blog = get_site_by_path( $domain, $path, 1 + count( explode( '/', trim( $current_site->path, '/' ) ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> // Otherwise, use the first path segment (as usual).
</span></span></pre></div>
<a id="trunksrcwpincludesmssitephp"></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/ms-site.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-site.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/ms-site.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,8 +114,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta['WPLANG'] = get_network_option( $new_site->network_id, 'WPLANG' );
</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">- // Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using allowed keys.
- // The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using allowed keys.
+ * The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = array_merge( array_intersect_key( $data, array_flip( $allowed_data_fields ) ), $meta );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesnavmenuphp"></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/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/nav-menu.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/nav-menu.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -547,8 +547,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'wp_add_nav_menu_item', $menu_id, $menu_item_db_id, $args );
</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">- // Associate the menu item with the menu term.
- // Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Associate the menu item with the menu term.
+ * Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms().
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $update_terms = wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $update_terms ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesoptionphp"></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/option.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/option.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/option.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -664,8 +664,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = sanitize_option( $option, $value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Make sure the option doesn't already exist.
- // We can check the 'notoptions' cache before we ask for a DB query.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Make sure the option doesn't already exist.
+ * We can check the 'notoptions' cache before we ask for a DB query.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $notoptions = wp_cache_get( 'notoptions', 'options' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -998,8 +1000,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $result = add_option( $transient_option, $value, '', $autoload );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If expiration is requested, but the transient has no timeout option,
- // delete, then re-create transient rather than update.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If expiration is requested, but the transient has no timeout option,
+ * delete, then re-create transient rather than update.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $update = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $expiration ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1598,8 +1602,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_key = "$network_id:$option";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Make sure the option doesn't already exist.
- // We can check the 'notoptions' cache before we ask for a DB query.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Make sure the option doesn't already exist.
+ * We can check the 'notoptions' cache before we ask for a DB query.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $notoptions = wp_cache_get( $notoptions_key, 'site-options' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) {
</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-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/pluggable.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,8 +267,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = array();
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $headers ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Explode the headers out, so this function can take
- // both string headers and an array of headers.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Explode the headers out, so this function can take
+ * both string headers and an array of headers.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $tempheaders = $headers;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -616,8 +618,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = apply_filters( 'authenticate', null, $username, $password );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null == $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // TODO: What should the error message be? (Or would these even happen?)
- // Only needed if all authentication handlers fail to return anything.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * TODO: What should the error message be? (Or would these even happen?)
+ * Only needed if all authentication handlers fail to return anything.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_Error( 'authentication_failed', __( '<strong>Error:</strong> Invalid username, email address or incorrect password.' ) );
</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">@@ -1561,8 +1565,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $location = 'http:' . $location;
</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">- // In PHP 5 parse_url() may fail if the URL query part contains 'http://'.
- // See https://bugs.php.net/bug.php?id=38143
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * In PHP 5 parse_url() may fail if the URL query part contains 'http://'.
+ * See https://bugs.php.net/bug.php?id=38143
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $cut = strpos( $location, '?' );
</span><span class="cx" style="display: block; padding: 0 10px"> $test = $cut ? substr( $location, 0, $cut ) : $location;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1587,8 +1593,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $location = '/' . ltrim( $path . '/', '/' ) . $location;
</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">- // Reject if certain components are set but host is not.
- // This catches URLs like https:host.com for which parse_url() does not set the host field.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Reject if certain components are set but host is not.
+ * This catches URLs like https:host.com for which parse_url() does not set the host field.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $fallback_url;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1714,8 +1722,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_author_domain = gethostbyaddr( $comment->comment_author_IP );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
- // We want to reverse this for the plain text arena of emails.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
+ * We want to reverse this for the plain text arena of emails.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_content = wp_specialchars_decode( $comment->comment_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1903,8 +1913,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments_waiting = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '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">- // The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
- // We want to reverse this for the plain text arena of emails.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
+ * We want to reverse this for the plain text arena of emails.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_content = wp_specialchars_decode( $comment->comment_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2042,13 +2054,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User $user User object.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_password_change_notification( $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Send a copy of password change notification to the admin,
- // but check to see if it's the admin whose password we're changing, and skip this.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Send a copy of password change notification to the admin,
+ * but check to see if it's the admin whose password we're changing, and skip this.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: User name. */
</span><span class="cx" style="display: block; padding: 0 10px"> $message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
- // We want to reverse this for the plain text arena of emails.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
+ * We want to reverse this for the plain text arena of emails.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_password_change_notification_email = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2115,8 +2131,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_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">- // The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
- // We want to reverse this for the plain text arena of emails.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
+ * We want to reverse this for the plain text arena of emails.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
</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">@@ -2572,8 +2590,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'check_password', $check, $password, $hash, $user_id );
</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 the stored hash is longer than an MD5,
- // presume the new style phpass portable hash.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If the stored hash is longer than an MD5,
+ * presume the new style phpass portable hash.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $wp_hasher ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . WPINC . '/class-phpass.php';
</span><span class="cx" style="display: block; padding: 0 10px"> // By default, use the portable hash from phpass.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2651,8 +2671,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_rand( $min = null, $max = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $rnd_value;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Some misconfigured 32-bit environments (Entropy PHP, for example)
- // truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Some misconfigured 32-bit environments (Entropy PHP, for example)
+ * truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null === $min ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2687,8 +2709,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reset $rnd_value after 14 uses.
- // 32 (md5) + 40 (sha1) + 40 (sha1) / 8 = 14 random numbers from $rnd_value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Reset $rnd_value after 14 uses.
+ * 32 (md5) + 40 (sha1) + 40 (sha1) / 8 = 14 random numbers from $rnd_value.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( strlen( $rnd_value ) < 8 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_SETUP_CONFIG' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> static $seed = '';
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></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/post-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-template.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/post-template.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,8 +285,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Use the globals if the $post parameter was not specified,
- // but only after they have been set up in setup_postdata().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Use the globals if the $post parameter was not specified,
+ * but only after they have been set up in setup_postdata().
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( null === $post && did_action( 'the_post' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></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/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/post.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6614,8 +6614,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_attachment_thumb_url( $post_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = (int) $post_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">- // This uses image_downsize() which also looks for the (very) old format $image_meta['thumb']
- // when the newer format $image_meta['sizes']['thumbnail'] doesn't exist.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * This uses image_downsize() which also looks for the (very) old format $image_meta['thumb']
+ * when the newer format $image_meta['sizes']['thumbnail'] doesn't exist.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_url = wp_get_attachment_image_url( $post_id, 'thumbnail' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $thumbnail_url ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesqueryphp"></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/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/query.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/query.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1139,8 +1139,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If year, monthnum, or day have been specified, make our query more precise
- // just in case there are multiple identical _wp_old_slug values.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If year, monthnum, or day have been specified, make our query more precise
+ * just in case there are multiple identical _wp_old_slug values.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( get_query_var( 'year' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $query .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiphp"></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.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/rest-api.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -473,8 +473,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url .= $path;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
- // To work around this, we manually add index.php to the URL, avoiding the redirect.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * nginx only allows HTTP/1.0 methods when redirecting from / to /index.php.
+ * To work around this, we manually add index.php to the URL, avoiding the redirect.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! str_ends_with( $url, 'index.php' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url .= 'index.php';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -632,8 +634,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $response;
</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">- // While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide
- // all the required methods used in WP_REST_Server::dispatch().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide
+ * all the required methods used in WP_REST_Server::dispatch().
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $response instanceof WP_HTTP_Response ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_REST_Response(
</span><span class="cx" style="display: block; padding: 0 10px"> $response->get_data(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -945,13 +949,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $fields as $accepted_field ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check to see if $field is the parent of any item in $fields.
- // A field "parent" should be accepted if "parent.child" is accepted.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Check to see if $field is the parent of any item in $fields.
+ * A field "parent" should be accepted if "parent.child" is accepted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( str_starts_with( $accepted_field, "$field." ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Conversely, if "parent" is accepted, all "parent.child" fields
- // should also be accepted.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Conversely, if "parent" is accepted, all "parent.child" fields
+ * should also be accepted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( str_starts_with( $field, "$accepted_field." ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1609,8 +1617,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'null' => 'is_null',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Both arrays and objects allow empty strings to be converted to their types.
- // But the best answer for this type is a string.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Both arrays and objects allow empty strings to be converted to their types.
+ * But the best answer for this type is a string.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' === $value && in_array( 'string', $types, true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'string';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2191,8 +2201,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // The "format" keyword should only be applied to strings. However, for backward compatibility,
- // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The "format" keyword should only be applied to strings. However, for backward compatibility,
+ * we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $args['format'] )
</span><span class="cx" style="display: block; padding: 0 10px"> && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2858,8 +2870,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array Modified reduce accumulator.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function rest_preload_api_request( $memo, $path ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // array_reduce() doesn't support passing an array in PHP 5.2,
- // so we need to make sure we start with one.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * array_reduce() doesn't support passing an array in PHP 5.2,
+ * so we need to make sure we start with one.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $memo ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $memo = array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrevisionphp"></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/revision.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/revision.php 2023-07-10 22:36:06 UTC (rev 56191)
+++ trunk/src/wp-includes/revision.php 2023-07-10 22:46:22 UTC (rev 56192)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,8 +190,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $return = _wp_put_post_revision( $post );
</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 a limit for the number of revisions to keep has been set,
- // delete the oldest ones.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * If a limit for the number of revisions to keep has been set,
+ * delete the oldest ones.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $revisions_to_keep = wp_revisions_to_keep( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $revisions_to_keep < 0 ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -869,8 +871,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $locked = get_option( $lock );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $locked ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Can't write to the lock, and can't read the lock.
- // Something broken has happened.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Can't write to the lock, and can't read the lock.
+ * Something broken has happened.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -899,8 +903,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // 1 is the latest revision version, so we're already up to date.
- // No need to add a copy of the post as latest revision.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * 1 is the latest revision version, so we're already up to date.
+ * No need to add a copy of the post as latest revision.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 < $this_revision_version ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $add_last = false;
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span></span></pre>
</div>
</div>
</body>
</html>