<!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>[47557] trunk/src: Coding Standards: Use strict type check for `in_array()` and `array_search()`.</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/47557">47557</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/47557","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-04-09 15:41:04 +0000 (Thu, 09 Apr 2020)</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'>Coding Standards: Use strict type check for `in_array()` and `array_search()`.
This addresses all the remaining `WordPress.PHP.StrictInArray.MissingTrueStrict` issues in core.
Includes minor code layout fixes for better readability.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/47550">[47550]</a>.
See <a href="https://core.trac.wordpress.org/ticket/49542">#49542</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswalkercategorychecklistphp">trunk/src/wp-admin/includes/class-walker-category-checklist.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpfilesystembasephp">trunk/src/wp-admin/includes/class-wp-filesystem-base.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmsuserslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswptermslisttablephp">trunk/src/wp-admin/includes/class-wp-terms-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpadminincludesnavmenuphp">trunk/src/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunksrcwpadminincludespluginphp">trunk/src/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpadminincludesrevisionphp">trunk/src/wp-admin/includes/revision.php</a></li>
<li><a href="#trunksrcwpadminincludesscreenphp">trunk/src/wp-admin/includes/screen.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpadminnavmenusphp">trunk/src/wp-admin/nav-menus.php</a></li>
<li><a href="#trunksrcwpadminnetworksiteinfophp">trunk/src/wp-admin/network/site-info.php</a></li>
<li><a href="#trunksrcwpadminusersphp">trunk/src/wp-admin/users.php</a></li>
<li><a href="#trunksrcwpincludesclasshttpphp">trunk/src/wp-includes/class-http.php</a></li>
<li><a href="#trunksrcwpincludesclasswalkerpagephp">trunk/src/wp-includes/class-walker-page.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpcookiephp">trunk/src/wp-includes/class-wp-http-cookie.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpcurlphp">trunk/src/wp-includes/class-wp-http-curl.php</a></li>
<li><a href="#trunksrcwpincludesclasswpqueryphp">trunk/src/wp-includes/class-wp-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemephp">trunk/src/wp-includes/class-wp-theme.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizenavmenusettingphp">trunk/src/wp-includes/customize/class-wp-customize-nav-menu-setting.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludesnavmenutemplatephp">trunk/src/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesrewritephp">trunk/src/wp-includes/rewrite.php</a></li>
<li><a href="#trunksrcwpincludestaxonomyphp">trunk/src/wp-includes/taxonomy.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswalkercategorychecklistphp"></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/class-walker-category-checklist.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-walker-category-checklist.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/class-walker-category-checklist.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $class = in_array( $category->term_id, $args['popular_cats'], true ) ? ' class="popular-category"' : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,7 +91,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $aria_checked = 'false';
</span><span class="cx" style="display: block; padding: 0 10px"> $inner_class = 'category';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $category->term_id, $args['selected_cats'], true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $inner_class .= ' selected';
</span><span class="cx" style="display: block; padding: 0 10px"> $aria_checked = 'true';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,10 +102,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/category-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $is_selected = in_array( $category->term_id, $args['selected_cats'], true );
+ $is_disabled = ! empty( $args['disabled'] );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
</span><span class="cx" style="display: block; padding: 0 10px"> '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) .
- disabled( empty( $args['disabled'] ), false, false ) . ' /> ' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ checked( $is_selected, true, false ) .
+ disabled( $is_disabled, true, false ) . ' /> ' .
</ins><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/category-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpfilesystembasephp"></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/class-wp-filesystem-base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-base.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-base.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -401,7 +401,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attarray = preg_split( '//', $mode );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $key = array_search( $attarray[ $i ], $legal );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $key = array_search( $attarray[ $i ], $legal, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $realmode .= $legal[ $key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmsuserslisttablephp"></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/class-wp-ms-users-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,7 +505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $actions['delete'] = '<a href="' . esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
</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="trunksrcwpadminincludesclasswptermslisttablephp"></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/class-wp-terms-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-terms-list-table.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/class-wp-terms-list-table.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $my_parent = get_term( $p, $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> $my_parents[] = $my_parent;
</span><span class="cx" style="display: block; padding: 0 10px"> $p = $my_parent->parent;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $p, $parent_ids ) ) { // Prevent parent loops.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops.
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_ids[] = $p;
</span></span></pre></div>
<a id="trunksrcwpadminincludesdashboardphp"></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/dashboard.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/dashboard.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/dashboard.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -519,7 +519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_default_post_to_edit( 'post', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = get_current_user_id();
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't create an option if this is a super admin who does not belong to this site.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.
</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="trunksrcwpadminincludesmsphp"></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/ms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/ms.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -922,19 +922,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'fields' => array( 'ID', 'user_login' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $blog_users ) && ! empty( $blog_users ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $user_dropdown = '<label for="reassign_user" class="screen-reader-text">' . __( 'Select a user' ) . '</label>';
</span><span class="cx" style="display: block; padding: 0 10px"> $user_dropdown .= "<select name='blog[$user_id][$key]' id='reassign_user'>";
</span><span class="cx" style="display: block; padding: 0 10px"> $user_list = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $blog_users as $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $user->ID, $allusers ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! in_array( (int) $user->ID, $allusers, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' == $user_list ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user_list = $admin_out;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_dropdown .= $user_list;
</span><span class="cx" style="display: block; padding: 0 10px"> $user_dropdown .= "</select>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminincludesnavmenuphp"></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/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/nav-menu.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/nav-menu.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1149,8 +1149,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'draft,publish',
</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">- $messages = array();
- $menu_items = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $messages = array();
+ $menu_items = array();
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Index menu items by DB ID.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $unsorted_menu_items as $_item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_items[ $_item->db_id ] = $_item;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1173,6 +1175,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"> wp_defer_term_counting( true );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Loop through all the menu items' POST variables.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $_POST['menu-item-db-id'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1209,19 +1212,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Store 'auto-add' pages.
</span><span class="cx" style="display: block; padding: 0 10px"> $auto_add = ! empty( $_POST['auto-add-pages'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_option = (array) get_option( 'nav_menu_options' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $nav_menu_option['auto_add'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_option['auto_add'] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $auto_add ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'], true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_option['auto_add'][] = $nav_menu_selected_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'], true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $nav_menu_option['auto_add'][ $key ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Remove non-existent/deleted menus.
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'nav_menu_options', $nav_menu_option );
</span></span></pre></div>
<a id="trunksrcwpadminincludespluginphp"></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/plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/plugin.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2170,7 +2170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $whitelist_options[ $page ] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $whitelist_options[ $page ][] = $key;
</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">- $pos = array_search( $key, $whitelist_options[ $page ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pos = array_search( $key, $whitelist_options[ $page ], true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $pos ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $whitelist_options[ $page ][] = $key;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2202,7 +2202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $del_options as $page => $keys ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $keys as $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $whitelist_options[ $page ] ) && is_array( $whitelist_options[ $page ] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pos = array_search( $key, $whitelist_options[ $page ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pos = array_search( $key, $whitelist_options[ $page ], true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $pos ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $whitelist_options[ $page ][ $pos ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludespostphp"></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/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/post.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/post.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -548,8 +548,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $children[] = $parent;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $page->ID == $parent ) {
- $parent = $page->post_parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( (int) $page->ID === $parent ) {
+ $parent = (int) $page->post_parent;
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</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">@@ -568,7 +568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $post_type_object )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- || ( isset( $children ) && in_array( $post_ID, $children ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ || ( isset( $children ) && in_array( $post_ID, $children, true ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> || ! current_user_can( 'edit_post', $post_ID )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $skipped[] = $post_ID;
</span></span></pre></div>
<a id="trunksrcwpadminincludesrevisionphp"></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/revision.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/revision.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/revision.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,7 +314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Now, grab the initial diff.
</span><span class="cx" style="display: block; padding: 0 10px"> $compare_two_mode = is_numeric( $from );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $compare_two_mode ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $found = array_search( $selected_revision_id, array_keys( $revisions ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $found = array_search( $selected_revision_id, array_keys( $revisions ), true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $found ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $from = reset( $from );
</span></span></pre></div>
<a id="trunksrcwpadminincludesscreenphp"></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/screen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/screen.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/screen.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,10 +128,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget_title = $box['args']['__widget_basename'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $is_hidden = in_array( $box['id'], $hidden, true );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> printf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<label for="%1$s-hide"><input class="hide-postbox-tog" name="%1$s-hide" type="checkbox" id="%1$s-hide" value="%1$s" %2$s />%3$s</label>',
</span><span class="cx" style="display: block; padding: 0 10px"> esc_attr( $box['id'] ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- checked( in_array( $box['id'], $hidden, true ), false, false ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ checked( $is_hidden, false, false ),
</ins><span class="cx" style="display: block; padding: 0 10px"> $widget_title
</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="trunksrcwpadminincludestemplatephp"></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/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/template.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/includes/template.php 2020-04-09 15:41:04 UTC (rev 47557)
</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"> $keys = array_keys( $categories );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $keys as $k ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $categories[ $k ]->term_id, $args['selected_cats'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $categories[ $k ]->term_id, $args['selected_cats'], true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $checked_categories[] = $categories[ $k ];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $categories[ $k ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,6 +228,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tax = get_taxonomy( $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $popular_ids = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $terms as $term ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $popular_ids[] = $term->term_id;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $echo ) { // Hack for Ajax use.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $id = "popular-$taxonomy-$term->term_id";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $checked = in_array( $term->term_id, $checked_terms ) ? 'checked="checked"' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $checked = in_array( $term->term_id, $checked_terms, true ) ? 'checked="checked"' : '';
</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"> <li id="<?php echo $id; ?>" class="popular-category">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/category-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $checked = in_array( $cat_id, $checked_categories, true ) ? ' checked="checked"' : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, '</label></li>';
</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">@@ -339,6 +340,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"> $taxonomy_names = get_object_taxonomies( $post->post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $taxonomy_names as $taxonomy_name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( $taxonomy_name );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,7 +723,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <select id="metakeyselect" name="metakeyselect">
</span><span class="cx" style="display: block; padding: 0 10px"> <option value="#NONE#"><?php _e( '— Select —' ); ?></option>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> foreach ( $keys as $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -834,6 +835,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"> echo "\n\n";
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $map = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'mm' => array( $mm, $cur_mm ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'jj' => array( $jj, $cur_jj ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -841,6 +843,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'hh' => array( $hh, $cur_hh ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'mn' => array( $mn, $cur_mn ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $map as $timeunit => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> list( $unit, $curr ) = $value;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -868,7 +871,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function page_template_dropdown( $default = '', $post_type = 'page' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $templates = get_page_templates( null, $post_type );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> ksort( $templates );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $templates ) as $template ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $selected = selected( $default, $templates[ $template ], false );
</span><span class="cx" style="display: block; padding: 0 10px"> echo "\n\t<option value='" . esc_attr( $templates[ $template ] ) . "' $selected>" . esc_html( $template ) . '</option>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1195,11 +1200,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Only show errors if the meta box was registered by a plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_normalize_path( $reflection->getFileName() );
</span><span class="cx" style="display: block; padding: 0 10px"> $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $filename, $plugin_dir ) === 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = str_replace( $plugin_dir, '', $filename );
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $plugins = get_plugins();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $plugins as $name => $plugin ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $name, $filename ) === 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $plugin;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1249,6 +1256,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Grab the ones the user has manually sorted.
</span><span class="cx" style="display: block; padding: 0 10px"> // Pull them out of their previous context/priority and into the one the user chose.
</span><span class="cx" style="display: block; padding: 0 10px"> $sorted = get_user_option( "meta-box-order_$page" );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $already_sorted && $sorted ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sorted as $box_context => $ids ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( explode( ',', $ids ) as $id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1780,11 +1788,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter the results to those of a specific setting if one was set.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $setting ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_errors = array();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $wp_settings_errors as $key => $details ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $setting == $details['setting'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_errors[] = $wp_settings_errors[ $key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $setting_errors;
</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">@@ -1833,6 +1843,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"> $output = '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $settings_errors as $key => $details ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'updated' === $details['type'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $details['type'] = 'success';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1855,6 +1866,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "<p><strong>{$details['message']}</strong></p>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "</div> \n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</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">@@ -2084,6 +2096,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_states_string .= ' — ';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_states as $state ) {
</span><span class="cx" style="display: block; padding: 0 10px"> ++$i;
</span><span class="cx" style="display: block; padding: 0 10px"> ( $i == $state_count ) ? $sep = '' : $sep = ', ';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2188,7 +2201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_random_header_image() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $header_images = wp_list_pluck( get_uploaded_header_images(), 'attachment_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">- if ( $meta_header == $stylesheet && in_array( $post->ID, $header_images ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $meta_header == $stylesheet && in_array( $post->ID, $header_images, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $media_states[] = __( 'Header Image' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2242,7 +2255,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $media_states ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $state_count = count( $media_states );
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> echo ' — ';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $media_states as $state ) {
</span><span class="cx" style="display: block; padding: 0 10px"> ++$i;
</span><span class="cx" style="display: block; padding: 0 10px"> ( $i == $state_count ) ? $sep = '' : $sep = ', ';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2369,12 +2384,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $button_shorthand = array( 'primary', 'small', 'large' );
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = array( 'button' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $type as $t ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'secondary' === $t || 'button-secondary' === $t ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $classes[] = in_array( $t, $button_shorthand, true ) ? 'button-' . $t : $t;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Remove empty items, remove duplicate items, and finally build a string.
</span><span class="cx" style="display: block; padding: 0 10px"> $class = implode( ' ', array_unique( array_filter( $classes ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminnavmenusphp"></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/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/nav-menus.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/nav-menus.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,9 +104,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $next_item_data['menu_item_parent'] != $menu_item_data['menu_item_parent']
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) {
+ $parent_db_id = (int) $menu_item_data['menu_item_parent'];
+ } else {
+ $parent_db_id = 0;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
-
</del><span class="cx" style="display: block; padding: 0 10px"> $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $parent_object ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // The item is last but still has a parent, so bubble up.
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (
</span><span class="cx" style="display: block; padding: 0 10px"> ! empty( $menu_item_data['menu_item_parent'] ) &&
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true );
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,11 +171,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // If this menu item is a child of the previous.
</span><span class="cx" style="display: block; padding: 0 10px"> if (
</span><span class="cx" style="display: block; padding: 0 10px"> ! empty( $menu_item_data['menu_item_parent'] ) &&
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) &&
</ins><span class="cx" style="display: block; padding: 0 10px"> isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> ( $menu_item_data['menu_item_parent'] == $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) {
+ $parent_db_id = (int) $menu_item_data['menu_item_parent'];
+ } else {
+ $parent_db_id = 0;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $parent_object ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_possible_parent_id = (int) get_post_meta( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ], '_menu_item_menu_item_parent', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $menu_item_data['menu_item_parent'] = $_possible_parent_id;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_item_data['menu_item_parent'] = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,7 +233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (
</span><span class="cx" style="display: block; padding: 0 10px"> empty( $menu_item_data['menu_order'] ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> empty( $menu_item_data['menu_item_parent'] ) ||
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ! in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) ||
</ins><span class="cx" style="display: block; padding: 0 10px"> empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] != $menu_item_data['menu_item_parent']
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,9 +808,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> echo esc_html( $_nav_menu->truncated_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 ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $locations_assigned_to_this_menu = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ foreach ( array_keys( $menu_locations, $_nav_menu->term_id, true ) as $menu_location_key ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $locations[ $menu_location_key ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -815,8 +824,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $locations Number of menu locations to list. Default 3.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $locations_listed_per_menu = absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, $locations_listed_per_menu );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Adds ellipses following the number of locations defined in $assigned_locations.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $assigned_locations ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> printf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,9 +967,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $auto_add ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $auto_add = get_option( 'nav_menu_options' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $auto_add['auto_add'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $auto_add = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'], true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $auto_add = true;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $auto_add = false;
</span></span></pre></div>
<a id="trunksrcwpadminnetworksiteinfophp"></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/network/site-info.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-info.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/network/site-info.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,8 +72,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $existing_details = get_site( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $blog_data_checkboxes as $c ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! in_array( (int) $existing_details->$c, array( 0, 1 ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $blog_data[ $c ] = $existing_details->$c;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,7 +195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <fieldset>
</span><span class="cx" style="display: block; padding: 0 10px"> <legend class="screen-reader-text"><?php _e( 'Set site attributes' ); ?></legend>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( (int) $details->$field_key, array( 0, 1 ), true ) ); ?> />
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php echo $field_label; ?></label><br/>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <fieldset>
</span></span></pre></div>
<a id="trunksrcwpadminusersphp"></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/users.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/users.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-admin/users.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_userids = $userids;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $current_user->ID, $userids ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $current_user->ID, $userids, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $userids = array_diff( $userids, array( $current_user->ID ) );
</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="trunksrcwpincludesclasshttpphp"></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-http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-http.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-http.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1041,7 +1041,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // POST requests should not POST to a redirected location.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'POST' == $args['method'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $response['response']['code'], array( 302, 303 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $response['response']['code'], array( 302, 303 ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args['method'] = 'GET';
</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="trunksrcwpincludesclasswalkerpagephp"></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-walker-page.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-walker-page.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-walker-page.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,12 +122,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $current_page ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_current_page = get_post( $current_page );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $css_class[] = 'current_page_ancestor';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $page->ID == $current_page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $css_class[] = 'current_page_item';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $css_class[] = 'current_page_parent';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( get_option( 'page_for_posts' ) == $page->ID ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswphttpcookiephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-http-cookie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-cookie.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-wp-http-cookie.php 2020-04-09 15:41:04 UTC (rev 47557)
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Port - supports "port-lists" in the format: "80,8000,8080".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $port ) && ! in_array( $url['port'], explode( ',', $port ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) {
</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="trunksrcwpincludesclasswphttpcurlphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-http-curl.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-curl.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-wp-http-curl.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,7 +238,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> curl_close( $handle );
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_request_failed', $curl_error );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_close( $handle );
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_request_failed', $curl_error );
</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 ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_close( $handle );
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-query.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-wp-query.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3137,7 +3137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sticky_offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> // Loop over posts and relocate stickies to the front.
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < $num_posts; $i++ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $this->posts[ $i ]->ID, $sticky_posts ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $this->posts[ $i ]->ID, $sticky_posts, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sticky_post = $this->posts[ $i ];
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove sticky from current position.
</span><span class="cx" style="display: block; padding: 0 10px"> array_splice( $this->posts, $i, 1 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3146,7 +3146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Increment the sticky offset. The next sticky will be placed at this offset.
</span><span class="cx" style="display: block; padding: 0 10px"> $sticky_offset++;
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove post from sticky posts array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $offset = array_search( $sticky_post->ID, $sticky_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $offset = array_search( $sticky_post->ID, $sticky_posts, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $sticky_posts[ $offset ] );
</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="trunksrcwpincludesclasswpthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/class-wp-theme.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->headers = get_file_data( $this->theme_root . '/' . $theme_file, self::$file_headers, 'theme' );
</span><span class="cx" style="display: block; padding: 0 10px"> // Default themes always trump their pretenders.
</span><span class="cx" style="display: block; padding: 0 10px"> // Properly identify default themes that are inside a directory within wp-content/themes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $default_theme_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( basename( $this->stylesheet ) != $default_theme_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->headers['Name'] .= '/' . $this->stylesheet;
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizenavmenusettingphp"></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/customize/class-wp-customize-nav-menu-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-nav-menu-setting.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/customize/class-wp-customize-nav-menu-setting.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value['auto_add'] = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $nav_menu_options['auto_add'] ) && is_array( $nav_menu_options['auto_add'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $value['auto_add'] = in_array( $term->term_id, $nav_menu_options['auto_add'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $value['auto_add'] = in_array( $term->term_id, $nav_menu_options['auto_add'], true );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,6 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $this->default;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -602,7 +603,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options['auto_add'] = array();
</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">- $i = array_search( $menu_id, $nav_menu_options['auto_add'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $i = array_search( $menu_id, $nav_menu_options['auto_add'], true );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $auto_add && false === $i ) {
</span><span class="cx" style="display: block; padding: 0 10px"> array_push( $nav_menu_options['auto_add'], $this->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $auto_add && false !== $i ) {
</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 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/general-template.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2180,9 +2180,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'",
</span><span class="cx" style="display: block; padding: 0 10px"> ARRAY_N
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $dayswithposts ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $dayswithposts as $daywith ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $daywithpost[] = $daywith[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $daywithpost[] = (int) $daywith[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2209,7 +2210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= '<td>';
</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 ( in_array( $day, $daywithpost ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $day, $daywithpost, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Any posts today?
</span><span class="cx" style="display: block; padding: 0 10px"> $date_format = gmdate( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: Post calendar label. %s: Date. */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2223,6 +2224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= $day;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= '</td>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 6 == calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2234,6 +2236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 != $pad && 7 != $pad ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= "\n\t\t" . '<td class="pad" colspan="' . esc_attr( $pad ) . '"> </td>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= "\n\t</tr>\n\t</tbody>";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $calendar_output .= "\n\t</table>";
</span></span></pre></div>
<a id="trunksrcwpincludeslinktemplatephp"></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/link-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/link-template.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/link-template.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3687,6 +3687,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = $user_id ? (int) $user_id : get_current_user_id();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blogs = get_blogs_of_user( $user_id );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = user_admin_url( $path, $scheme );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! is_multisite() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3693,7 +3694,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = admin_url( $path, $scheme );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_blog = get_current_blog_id();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = admin_url( $path, $scheme );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $active = get_active_blog_for_user( $user_id );
</span></span></pre></div>
<a id="trunksrcwpincludesnavmenutemplatephp"></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-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/nav-menu-template.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/nav-menu-template.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -392,7 +392,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If the menu item corresponds to a taxonomy term for the currently queried non-hierarchical post object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array( $menu_item->object_id, $possible_object_parents ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type
+ && in_array( (int) $menu_item->object_id, $possible_object_parents, true )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $active_parent_object_ids[] = (int) $menu_item->object_id;
</span><span class="cx" style="display: block; padding: 0 10px"> $active_parent_item_ids[] = (int) $menu_item->db_id;
</span><span class="cx" style="display: block; padding: 0 10px"> $active_object = $queried_object->post_type;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +406,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id )
</span><span class="cx" style="display: block; padding: 0 10px"> || ( 'post_type' == $menu_item->type && $wp_query->is_singular )
</span><span class="cx" style="display: block; padding: 0 10px"> || ( 'taxonomy' == $menu_item->type
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) && $queried_object->taxonomy == $menu_item->object )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax )
+ && $queried_object->taxonomy == $menu_item->object )
</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"> $classes[] = 'current-menu-item';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,7 +528,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' == $parent_item->type
</span><span class="cx" style="display: block; padding: 0 10px"> && ! empty( $queried_object->post_type )
</span><span class="cx" style="display: block; padding: 0 10px"> && is_post_type_hierarchical( $queried_object->post_type )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && in_array( $parent_item->object_id, $queried_object->ancestors )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && in_array( (int) $parent_item->object_id, $queried_object->ancestors, true )
</ins><span class="cx" style="display: block; padding: 0 10px"> && $parent_item->object != $queried_object->ID
</span><span class="cx" style="display: block; padding: 0 10px"> ) ||
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -533,7 +536,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (
</span><span class="cx" style="display: block; padding: 0 10px"> 'taxonomy' == $parent_item->type
</span><span class="cx" style="display: block; padding: 0 10px"> && isset( $possible_taxonomy_ancestors[ $parent_item->object ] )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && in_array( (int) $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ], true )
</ins><span class="cx" style="display: block; padding: 0 10px"> && (
</span><span class="cx" style="display: block; padding: 0 10px"> ! isset( $queried_object->term_id ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_item->object_id != $queried_object->term_id
</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 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/post.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2284,7 +2284,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $stickies = get_option( 'sticky_posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $is_sticky = is_array( $stickies ) && in_array( $post_id, $stickies );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_array( $stickies ) ) {
+ $stickies = array_map( 'intval', $stickies );
+ $is_sticky = in_array( $post_id, $stickies, true );
+ } else {
+ $is_sticky = false;
+ }
</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"> * Filters whether a post is sticky.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2511,13 +2516,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function stick_post( $post_id ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> $stickies = get_option( 'sticky_posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $stickies ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stickies = array( $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stickies = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $post_id, $stickies ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stickies = array_map( 'intval', $stickies );
+
+ if ( ! in_array( $post_id, $stickies, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $stickies[] = $post_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2545,6 +2553,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function unstick_post( $post_id ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_id = (int) $post_id;
</ins><span class="cx" style="display: block; padding: 0 10px"> $stickies = get_option( 'sticky_posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $stickies ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2551,11 +2560,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $post_id, $stickies ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stickies = array_map( 'intval', $stickies );
+
+ if ( ! in_array( $post_id, $stickies, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $offset = array_search( $post_id, $stickies );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $offset = array_search( $post_id, $stickies, true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === $offset ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2841,8 +2852,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $wildcard_mime_types as $type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $mimes = array_map( 'trim', explode( ',', $type ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $mimes as $mime ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $patternses[][ $type ] = "^$regex$";
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false === strpos( $mime, '/' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $patternses[][ $type ] = "^$regex/";
</span><span class="cx" style="display: block; padding: 0 10px"> $patternses[][ $type ] = $regex;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2854,12 +2867,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $patternses as $patterns ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $patterns as $type => $pattern ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $real_mime_types as $real ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( preg_match( "#$pattern#", $real ) && ( empty( $matches[ $type ] ) || false === array_search( $real, $matches[ $type ] ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( preg_match( "#$pattern#", $real )
+ && ( empty( $matches[ $type ] ) || false === array_search( $real, $matches[ $type ], true ) )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $matches[ $type ][] = $real;
</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><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $matches;
</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">@@ -2914,9 +2930,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wheres[] = empty( $table_alias ) ? "post_mime_type = '$mime_pattern'" : "$table_alias.post_mime_type = '$mime_pattern'";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $wheres ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $where = ' AND (' . join( ' OR ', $wheres ) . ') ';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $where;
</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">@@ -4436,8 +4454,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
</span><span class="cx" style="display: block; padding: 0 10px"> $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post_ID );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Prevent new post slugs that could result in URLs that conflict with date archives.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post_ID );
</del><span class="cx" style="display: block; padding: 0 10px"> $conflicts_with_date_archive = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'post' === $post_type && ( ! $post || $post->post_name !== $slug ) && preg_match( '/^[0-9]+$/', $slug ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $slug_num = intval( $slug );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4444,7 +4463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $slug_num ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $permastructs = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $postname_index = array_search( '%postname%', $permastructs );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $postname_index = array_search( '%postname%', $permastructs, true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Potential date clashes are as follows:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5500,7 +5519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_pages = count( $pages );
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < $num_pages; $i++ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $pages[ $i ]->ID, $exclude ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $pages[ $i ]->ID, $exclude, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $pages[ $i ] );
</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">@@ -5811,7 +5830,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = (int) $attachment_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $attachment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post = get_post( $attachment_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5845,7 +5865,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_update_attachment_metadata( $attachment_id, $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = (int) $attachment_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $attachment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post = get_post( $attachment_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5878,7 +5899,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_attachment_url( $attachment_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = (int) $attachment_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $attachment_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $post = get_post( $attachment_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesrewritephp"></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/rewrite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rewrite.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/rewrite.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -596,7 +596,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parse_str( $query, $query_vars );
</span><span class="cx" style="display: block; padding: 0 10px"> $query = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $query_vars as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $key, $wp->public_query_vars, true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( (string) $key, $wp->public_query_vars, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $query[ $key ] = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_type_query_vars[ $key ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $query['post_type'] = $post_type_query_vars[ $key ];
</span></span></pre></div>
<a id="trunksrcwpincludestaxonomyphp"></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/taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/taxonomy.php 2020-04-09 06:06:02 UTC (rev 47556)
+++ trunk/src/wp-includes/taxonomy.php 2020-04-09 15:41:04 UTC (rev 47557)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2468,16 +2468,20 @@
</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"> $term_info = term_exists( $term, $taxonomy );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $term_info ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip if a non-existent term ID is passed.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_int( $term ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $term_info = wp_insert_term( $term, $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $term_info ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $term_info;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $term_ids[] = $term_info['term_id'];
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_id = $term_info['term_taxonomy_id'];
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_ids[] = $tt_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2497,6 +2501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $taxonomy Taxonomy slug.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $wpdb->insert(
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->term_relationships,
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2516,6 +2521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $taxonomy Taxonomy slug.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $new_tt_ids[] = $tt_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2539,9 +2545,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"> $t = get_taxonomy( $taxonomy );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $append && isset( $t->sort ) && $t->sort ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $values = array();
- $term_order = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $values = array();
+ $term_order = 0;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $final_tt_ids = wp_get_object_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> $object_id,
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2550,11 +2558,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'update_term_meta_cache' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tt_ids as $tt_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $tt_id, $final_tt_ids ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( (int) $tt_id, $final_tt_ids, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $values[] = $wpdb->prepare( '(%d, %d, %d)', $object_id, $tt_id, ++$term_order );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $values ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2578,6 +2588,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $old_tt_ids Old array of term taxonomy IDs.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $tt_ids;
</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">@@ -3616,8 +3627,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tax_obj = get_taxonomy( $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> $object_types = esc_sql( $tax_obj->object_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode( ',', array_keys( $term_ids ) ) . ") AND post_type IN ('" . implode( "', '", $object_types ) . "') AND post_status = 'publish'" );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $row ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $id = $term_ids[ $row->term_taxonomy_id ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $id = $term_ids[ $row->term_taxonomy_id ];
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $term_items[ $id ][ $row->object_id ] = isset( $term_items[ $id ][ $row->object_id ] ) ? ++$term_items[ $id ][ $row->object_id ] : 1;
</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">@@ -3627,14 +3640,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ancestors = array();
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ! empty( $terms_by_id[ $child ] ) && $parent = $terms_by_id[ $child ]->parent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ancestors[] = $child;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $term_items[ $term_id ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $term_items[ $term_id ] as $item_id => $touches ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $term_items[ $parent ][ $item_id ] = isset( $term_items[ $parent ][ $item_id ] ) ? ++$term_items[ $parent ][ $item_id ] : 1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $child = $parent;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $parent, $ancestors ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $parent, $ancestors, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</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">@@ -4522,7 +4537,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'taxonomy' === $resource_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $object_id, $object_type );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while ( ! is_wp_error( $term ) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while ( ! is_wp_error( $term ) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $ancestors[] = (int) $term->parent;
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $term->parent, $object_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>