<!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>[47084] trunk/src/wp-admin/includes: Docs: Improve comments in some `wp-admin` files per the documentation standards.</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/47084">47084</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/47084","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-01-18 00:52:28 +0000 (Sat, 18 Jan 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'>Docs: Improve comments in some `wp-admin` files per the documentation standards.
Props passoniate.
Fixes <a href="https://core.trac.wordpress.org/ticket/49215">#49215</a>, <a href="https://core.trac.wordpress.org/ticket/49216">#49216</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludescommentphp">trunk/src/wp-admin/includes/comment.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesdeprecatedphp">trunk/src/wp-admin/includes/deprecated.php</a></li>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
<li><a href="#trunksrcwpadminincludesimageeditphp">trunk/src/wp-admin/includes/image-edit.php</a></li>
<li><a href="#trunksrcwpadminincludesimagephp">trunk/src/wp-admin/includes/image.php</a></li>
<li><a href="#trunksrcwpadminincludesimportphp">trunk/src/wp-admin/includes/import.php</a></li>
<li><a href="#trunksrcwpadminincludeslisttablephp">trunk/src/wp-admin/includes/list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludesmenuphp">trunk/src/wp-admin/includes/menu.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludescommentphp"></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/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/comment.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/comment.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pending_keyed = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Default to zero pending for all posts in request
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Default to zero pending for all posts in request.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_id_array as $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $pending_keyed[ $id ] = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/dashboard.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_site_health', __( 'Site Health Status' ), 'wp_dashboard_site_health' );
</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">- // Right Now
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Right Now.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_right_now', __( 'At a Glance' ), 'wp_dashboard_right_now' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,18 +65,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
</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">- // Activity Widget
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Activity Widget.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_blog_admin() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_site_activity' );
</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">- // QuickPress Widget
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // QuickPress Widget.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $quick_draft_title = sprintf( '<span class="hide-if-no-js">%1$s</span> <span class="hide-if-js">%2$s</span>', __( 'Quick Draft' ), __( 'Your Recent Drafts' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_quick_press', $quick_draft_title, 'wp_dashboard_quick_press' );
</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">- // WordPress Events and News
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // WordPress Events and News.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress Events and News' ), 'wp_dashboard_events_news' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_network_admin() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,7 +139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget_id'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'edit-dashboard-widget_' . $_POST['widget_id'], 'dashboard-widget-nonce' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ob_start(); // hack - but the same hack wp-admin/widgets.php uses
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ob_start(); // Hack - but the same hack wp-admin/widgets.php uses.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_dashboard_trigger_widget_control( $_POST['widget_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> ob_end_clean();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_redirect( remove_query_arg( 'edit' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,7 +278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="main">
</span><span class="cx" style="display: block; padding: 0 10px"> <ul>
</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">- // Posts and Pages
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Posts and Pages.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'post', 'page' ) as $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $num_posts = wp_count_posts( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $num_posts && $num_posts->publish ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +298,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Comments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Comments.
</ins><span class="cx" style="display: block; padding: 0 10px"> $num_comm = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Number of comments. */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,14 +506,14 @@
</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"> /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $last_post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $last_post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore.
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_default_post_to_edit( 'post', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post->post_title = ''; // Remove the auto draft title
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post->post_title = ''; // Remove the auto draft title.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_default_post_to_edit( 'post', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +520,7 @@
</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><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -760,7 +760,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ++$i;
</span><span class="cx" style="display: block; padding: 0 10px"> ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Reply and quickedit need a hide-if-no-js span
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Reply and quickedit need a hide-if-no-js span.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'reply' == $action || 'quickedit' == $action ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $action .= ' hide-if-no-js';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1108,7 +1108,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array_unshift( $args, $widget_id, $check_urls );
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func_array( $callback, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Default lifetime in cache of 12 hours (same as the feeds).
+ set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1163,7 +1164,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget_options[ $widget_id ] = 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">- $number = 1; // Hack to use wp_widget_rss_form()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $number = 1; // Hack to use wp_widget_rss_form().
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $widget_options[ $widget_id ]['number'] = $number;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['widget-rss'][ $number ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1662,7 +1664,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = get_site_transient( 'browser_' . $key );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // include an unmodified $wp_version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Include an unmodified $wp_version.
</ins><span class="cx" style="display: block; padding: 0 10px"> include( ABSPATH . WPINC . '/version.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://api.wordpress.org/core/browse-happy/1.1/';
</span></span></pre></div>
<a id="trunksrcwpadminincludesdeprecatedphp"></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/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/deprecated.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/deprecated.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,7 +233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !is_multisite() )
</span><span class="cx" style="display: block; padding: 0 10px"> $level_key = $wpdb->get_blog_prefix() . 'user_level';
</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">- $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,7 +295,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !is_multisite() )
</span><span class="cx" style="display: block; padding: 0 10px"> $level_key = $wpdb->get_blog_prefix() . 'user_level';
</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">- $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $exclude_zeros )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !is_multisite() )
</span><span class="cx" style="display: block; padding: 0 10px"> $level_key = $wpdb->get_blog_prefix() . 'user_level';
</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">- $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -544,7 +544,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $level_key = $wpdb->prefix . 'capabilities'; // WPMU site admins don't have user_levels.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->query_from .= ", $wpdb->usermeta";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -564,7 +564,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->results )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // No limit.
</ins><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -584,7 +584,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function do_paging() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $this->total_users_for_query > $this->users_per_page ) { // Have to page the results.
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty($this->search_term) )
</span><span class="cx" style="display: block; padding: 0 10px"> $args['usersearch'] = urlencode($this->search_term);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1319,7 +1319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_dashboard_plugins_output( $rss, $args = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '4.8.0' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Plugin feeds plus link to install them
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Plugin feeds plus link to install them.
</ins><span class="cx" style="display: block; padding: 0 10px"> $popular = fetch_feed( $args['url']['popular'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1335,9 +1335,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $items = $feed->get_items(0, 5);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Pick a random, non-installed plugin
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Pick a random, non-installed plugin.
</ins><span class="cx" style="display: block; padding: 0 10px"> while ( true ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Abort this foreach loop iteration if there's no plugins left of this type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Abort this foreach loop iteration if there's no plugins left of this type.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 == count($items) )
</span><span class="cx" style="display: block; padding: 0 10px"> continue 2;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1367,7 +1367,7 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Eliminate some common badly formed plugin descriptions
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Eliminate some common badly formed plugin descriptions.
</ins><span class="cx" style="display: block; padding: 0 10px"> while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> unset($items[$item_key]);
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesfilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/file.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/file.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'searchform.php' => __( 'Search Form' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '404.php' => __( '404 Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'link.php' => __( 'Links Template' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Archives
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Archives.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'index.php' => __( 'Main Index Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'archive.php' => __( 'Archives' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'author.php' => __( 'Author Template' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,33 +31,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'home.php' => __( 'Posts Page' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'search.php' => __( 'Search Results' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'date.php' => __( 'Date Template' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Content
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Content.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'singular.php' => __( 'Singular Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'single.php' => __( 'Single Post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'page.php' => __( 'Single Page' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'front-page.php' => __( 'Homepage' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'privacy-policy.php' => __( 'Privacy Policy Page' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Attachments
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Attachments.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'attachment.php' => __( 'Attachment Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'image.php' => __( 'Image Attachment Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'video.php' => __( 'Video Attachment Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'audio.php' => __( 'Audio Attachment Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'application.php' => __( 'Application Attachment Template' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Embeds
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Embeds.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'embed.php' => __( 'Embed Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'embed-404.php' => __( 'Embed 404 Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'embed-content.php' => __( 'Embed Content Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'header-embed.php' => __( 'Embed Header Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'footer-embed.php' => __( 'Embed Footer Template' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Stylesheets
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Stylesheets.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'style.css' => __( 'Stylesheet' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'editor-style.css' => __( 'Visual Editor Stylesheet' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'editor-style-rtl.css' => __( 'Visual Editor RTL Stylesheet' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'rtl.css' => __( 'RTL Stylesheet' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Other
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Other.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '.htaccess' => __( '.htaccess (for rewrite rules )' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Deprecated files
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Deprecated files.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wp-layout.css' => __( 'Stylesheet' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-comments.php' => __( 'Comments Template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-comments-popup.php' => __( 'Popup Comments Template' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,7 +455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Compare based on relative paths
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Compare based on relative paths.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 !== validate_file( $file, array_keys( $allowed_files ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'disallowed_theme_file', __( 'Sorry, that file cannot be edited.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,7 +507,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scrape_key = md5( rand() );
</span><span class="cx" style="display: block; padding: 0 10px"> $transient = 'scrape_key_' . $scrape_key;
</span><span class="cx" style="display: block; padding: 0 10px"> $scrape_nonce = strval( rand() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- set_transient( $transient, $scrape_nonce, 60 ); // It shouldn't take more than 60 seconds to make the two loopback requests.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // It shouldn't take more than 60 seconds to make the two loopback requests.
+ set_transient( $transient, $scrape_nonce, 60 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cookies = wp_unslash( $_COOKIE );
</span><span class="cx" style="display: block; padding: 0 10px"> $scrape_params = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -644,7 +645,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = uniqid();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Use the basename of the given file without the extension as the name for the temporary directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Use the basename of the given file without the extension as the name for the temporary directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> $temp_filename = basename( $filename );
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_filename = preg_replace( '|\.[^.]*$|', '', $temp_filename );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -653,7 +654,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return wp_tempnam( dirname( $filename ), $dir );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Suffix some random data to avoid filename conflicts
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Suffix some random data to avoid filename conflicts.
</ins><span class="cx" style="display: block; padding: 0 10px"> $temp_filename .= '-' . wp_generate_password( 6, false );
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_filename .= '.tmp';
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_filename = $dir . wp_unique_filename( $dir, $temp_filename );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -735,7 +736,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $file = apply_filters( "{$action}_prefilter", $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // You may define your own function and pass the name in $overrides['upload_error_handler']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // You may define your own function and pass the name in $overrides['upload_error_handler'].
</ins><span class="cx" style="display: block; padding: 0 10px"> $upload_error_handler = 'wp_handle_upload_error';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $overrides['upload_error_handler'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $upload_error_handler = $overrides['upload_error_handler'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -748,7 +749,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Install user overrides. Did we mention that this voids your warranty?
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // You may define your own function and pass the name in $overrides['unique_filename_callback']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // You may define your own function and pass the name in $overrides['unique_filename_callback'].
</ins><span class="cx" style="display: block; padding: 0 10px"> $unique_filename_callback = null;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $overrides['unique_filename_callback'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $unique_filename_callback = $overrides['unique_filename_callback'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -822,7 +823,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> $proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $proper_filename ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file['name'] = $proper_filename;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -869,7 +870,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'wp_handle_upload' === $action ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $move_new_file = @move_uploaded_file( $file['tmp_name'], $new_file );
</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">- // use copy and unlink because rename breaks streams.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Use copy and unlink because rename breaks streams.
</ins><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
</span><span class="cx" style="display: block; padding: 0 10px"> $move_new_file = @copy( $file['tmp_name'], $new_file );
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $file['tmp_name'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1001,7 +1002,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|WP_Error Filename on success, WP_Error on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function download_url( $url, $timeout = 300, $signature_verification = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //WARNING: The file is not automatically deleted, The script must unlink() the file.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // WARNING: The file is not automatically deleted, the script must unlink() the file.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1082,7 +1083,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $signature = wp_remote_retrieve_header( $response, 'x-content-signature' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $signature ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Retrieve signatures from a file if the header wasn't included.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // WordPress.org stores signatures at $package_url.sig
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // WordPress.org stores signatures at $package_url.sig.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $signature_url = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $url_path = parse_url( $url, PHP_URL_PATH );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1104,7 +1105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $signature_request = wp_safe_remote_get(
</span><span class="cx" style="display: block; padding: 0 10px"> $signature_url,
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'limit_response_size' => 10 * 1024, // 10KB should be large enough for quite a few signatures.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'limit_response_size' => 10 * KB_IN_BYTES, // 10KB should be large enough for quite a few signatures.
</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">@@ -1161,7 +1162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 24 == strlen( $expected_md5 ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_raw_md5 = base64_decode( $expected_md5 );
</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">- return false; // unknown format
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false; // Unknown format.
</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"> $file_md5 = md5_file( $filename, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,7 +1211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check for a edge-case affecting PHP Maths abilities
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check for a edge-case affecting PHP Maths abilities.
</ins><span class="cx" style="display: block; padding: 0 10px"> if (
</span><span class="cx" style="display: block; padding: 0 10px"> ! extension_loaded( 'sodium' ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> in_array( PHP_VERSION_ID, [ 70200, 70201, 70202 ], true ) &&
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1250,7 +1251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:enable
</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">- // This cannot be performed in a reasonable amount of time
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This cannot be performed in a reasonable amount of time.
</ins><span class="cx" style="display: block; padding: 0 10px"> // https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $sodium_compat_is_fast ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1478,7 +1479,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
</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 ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1515,10 +1516,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $needed_dirs = array_unique( $needed_dirs );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $needed_dirs as $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the parent folders of the folders all exist within the creation array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, We know this exists (or will exist)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, Skip it
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1549,7 +1550,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1615,9 +1616,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uncompressed_size = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Determine any children directories needed (From within the archive)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Determine any children directories needed (From within the archive).
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $archive_files as $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1641,10 +1642,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $needed_dirs = array_unique( $needed_dirs );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $needed_dirs as $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the parent folders of the folders all exist within the creation array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, We know this exists (or will exist)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( untrailingslashit( $to ) == $dir ) { // Skip over the working directory, we know this exists (or will exist).
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, Skip it
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( strpos( $dir, $to ) === false ) { // If the directory is not within the working directory, skip it.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1665,13 +1666,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $needed_dirs );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Extract the files from the zip
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Extract the files from the zip.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $archive_files as $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $file['folder'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1730,7 +1731,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list.
</ins><span class="cx" style="display: block; padding: 0 10px"> $sub_skip_list = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $skip_list as $skip_item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strpos( $skip_item, $filename . '/' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1748,7 +1749,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Initialises and connects the WordPress Filesystem Abstraction classes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Initializes and connects the WordPress Filesystem Abstraction classes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function will include the chosen transport and attempt connecting.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1800,7 +1801,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_filesystem = new $method( $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Define the timeouts for the connections. Only available after the constructor is called
+ * to allow for per-transport overriding of the default.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'FS_CONNECT_TIMEOUT' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'FS_CONNECT_TIMEOUT', 30 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1813,7 +1817,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"> if ( ! $wp_filesystem->connect() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false; //There was an error connecting to the server.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false; // There was an error connecting to the server.
</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"> // Set the permission constants if not already set.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1854,7 +1858,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The transport to use, see description for valid return values.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_file_ownership = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $method = defined( 'FS_METHOD' ) ? FS_METHOD : false; // Please ensure that this is either 'direct', 'ssh2', 'ftpext' or 'ftpsockets'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Please ensure that this is either 'direct', 'ssh2', 'ftpext', or 'ftpsockets'.
+ $method = defined( 'FS_METHOD' ) ? FS_METHOD : false;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $context ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $context = WP_CONTENT_DIR;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1873,7 +1878,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_handle = @fopen( $temp_file_name, 'w' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $temp_handle ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Attempt to determine the file owner of the WordPress files, and that of newly created files
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Attempt to determine the file owner of the WordPress files, and that of newly created files.
</ins><span class="cx" style="display: block; padding: 0 10px"> $wp_file_owner = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_file_owner = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( function_exists( 'fileowner' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1882,13 +1887,18 @@
</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 ( $wp_file_owner !== false && $wp_file_owner === $temp_file_owner ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // WordPress is creating files as the same owner as the WordPress files,
- // this means it's safe to modify & create new files via PHP.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * WordPress is creating files as the same owner as the WordPress files,
+ * this means it's safe to modify & create new files via PHP.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $method = 'direct';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['_wp_filesystem_direct_method'] = 'file_owner';
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $allow_relaxed_file_ownership ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files
- // safely in this directory. This mode doesn't create new files, only alter existing ones.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The $context directory is writable, and $allow_relaxed_file_ownership is set,
+ * this means we can modify files safely in this directory.
+ * This mode doesn't create new files, only alter existing ones.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $method = 'direct';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['_wp_filesystem_direct_method'] = 'relaxed_ownership';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1905,7 +1915,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $method = 'ftpext';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $method && ( extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $method = 'ftpsockets'; // Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread.
</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">@@ -1998,7 +2008,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $submitted_form = wp_unslash( $_POST );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Verify nonce, or unset submitted form field values on failure
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Verify nonce, or unset submitted form field values on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $_POST['_fs_nonce'] ) || ! wp_verify_nonce( $_POST['_fs_nonce'], 'filesystem-credentials' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset(
</span><span class="cx" style="display: block; padding: 0 10px"> $submitted_form['hostname'],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2010,17 +2020,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If defined, set it to that. Else, if POST'd, set it to that. If not, set it to whatever it previously was (saved details in option).
</ins><span class="cx" style="display: block; padding: 0 10px"> $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : ( ! empty( $submitted_form['hostname'] ) ? $submitted_form['hostname'] : $credentials['hostname'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : ( ! empty( $submitted_form['username'] ) ? $submitted_form['username'] : $credentials['username'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ( ! empty( $submitted_form['password'] ) ? $submitted_form['password'] : '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check to see if we are setting the public/private keys for ssh
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check to see if we are setting the public/private keys for ssh.
</ins><span class="cx" style="display: block; padding: 0 10px"> $credentials['public_key'] = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ( ! empty( $submitted_form['public_key'] ) ? $submitted_form['public_key'] : '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ( ! empty( $submitted_form['private_key'] ) ? $submitted_form['private_key'] : '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Sanitize the hostname, Some people might pass in odd-data:
- $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); //Strip any schemes off
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Sanitize the hostname, some people might pass in odd data.
+ $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); // Strip any schemes off.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $credentials['hostname'], ':' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2033,11 +2043,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' == FS_METHOD ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['connection_type'] = 'ssh';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { // Only the FTP Extension understands SSL.
</ins><span class="cx" style="display: block; padding: 0 10px"> $credentials['connection_type'] = 'ftps';
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $submitted_form['connection_type'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $credentials['connection_type'] = $submitted_form['connection_type'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ! isset( $credentials['connection_type'] ) ) { // All else fails (and it's not defaulted to something else saved), default to FTP.
</ins><span class="cx" style="display: block; padding: 0 10px"> $credentials['connection_type'] = 'ftp';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $error &&
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2046,7 +2056,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ( 'ssh' == $credentials['connection_type'] && ! empty( $credentials['public_key'] ) && ! empty( $credentials['private_key'] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $stored_credentials = $credentials;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $stored_credentials['port'] ) ) { //save port as part of hostname to simplify above code.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $stored_credentials['port'] ) ) { // Save port as part of hostname to simplify above code.
</ins><span class="cx" style="display: block; padding: 0 10px"> $stored_credentials['hostname'] .= ':' . $stored_credentials['port'];
</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">@@ -2075,7 +2085,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( extension_loaded( 'ftp' ) || extension_loaded( 'sockets' ) || function_exists( 'fsockopen' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $types['ftp'] = __( 'FTP' );
</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 ( extension_loaded( 'ftp' ) ) { //Only this supports FTPS
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( extension_loaded( 'ftp' ) ) { // Only this supports FTPS.
</ins><span class="cx" style="display: block; padding: 0 10px"> $types['ftps'] = __( 'FTPS (SSL)' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesimageeditphp"></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/image-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image-edit.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/image-edit.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,7 +199,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // On some setups GD library does not provide imagerotate() - Ticket #11536
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // On some setups GD library does not provide imagerotate() - Ticket #11536.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp_image_editor_supports(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'mime_type' => get_post_mime_type( $post_id ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,10 +601,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $w = $size['width'];
</span><span class="cx" style="display: block; padding: 0 10px"> $h = $size['height'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $scale = 1 / _image_get_preview_ratio( $w, $h ); // discard preview scaling
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $scale = 1 / _image_get_preview_ratio( $w, $h ); // Discard preview scaling.
</ins><span class="cx" style="display: block; padding: 0 10px"> $image->crop( $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );
</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">- $scale = 1 / _image_get_preview_ratio( imagesx( $image ), imagesy( $image ) ); // discard preview scaling
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $scale = 1 / _image_get_preview_ratio( imagesx( $image ), imagesy( $image ) ); // Discard preview scaling.
</ins><span class="cx" style="display: block; padding: 0 10px"> $image = _crop_image_resource( $image, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -955,7 +955,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check if it's an image edit from attachment edit screen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check if it's an image edit from attachment edit screen.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $thumb_url = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $return->thumbnail = $thumb_url[0];
</span></span></pre></div>
<a id="trunksrcwpadminincludesimagephp"></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/image.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/image.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $src_file = $src;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_numeric( $src ) ) { // Handle int as attachment ID
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_numeric( $src ) ) { // Handle int as attachment ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> $src_file = get_attached_file( $src );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( $src_file ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,11 +117,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image_meta['sizes'] = 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">- // Remove sizes that already exist. Only checks for matching "size names".
- // It is possible that the dimensions for a particular size name have changed.
- // For example the user has changed the values on the Settings -> Media screen.
- // However we keep the old sub-sizes with the previous dimensions
- // as the image may have been used in an older post.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Remove sizes that already exist. Only checks for matching "size names".
+ * It is possible that the dimensions for a particular size name have changed.
+ * For example the user has changed the values on the Settings -> Media screen.
+ * However we keep the old sub-sizes with the previous dimensions
+ * as the image may have been used in an older post.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $missing_sizes = array_diff_key( $possible_sizes, $image_meta['sizes'] );
</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">@@ -229,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return 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">- // Default image meta
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Default image meta.
</ins><span class="cx" style="display: block; padding: 0 10px"> $image_meta = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => $imagesize[0],
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => $imagesize[1],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $image_meta;
</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">- // Rotate the image
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Rotate the image.
</ins><span class="cx" style="display: block; padding: 0 10px"> $rotated = $editor->maybe_exif_rotate();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === $rotated ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,9 +341,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Initial save of the new metadata.
- // At this point the file was uploaded and moved to the uploads directory
- // but the image sub-sizes haven't been created yet and the `sizes` array is empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Initial save of the new metadata.
+ * At this point the file was uploaded and moved to the uploads directory
+ * but the image sub-sizes haven't been created yet and the `sizes` array is empty.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_update_attachment_metadata( $attachment_id, $image_meta );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_sizes = wp_get_registered_image_subsizes();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -386,9 +390,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if any of the new sizes already exist.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $image_meta['sizes'] ) && is_array( $image_meta['sizes'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $image_meta['sizes'] as $size_name => $size_meta ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Only checks "size name" so we don't override existing images even if the dimensions
- // don't match the currently defined size with the same name.
- // To change the behavior, unset changed/mismatched sizes in the `sizes` array in image meta.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Only checks "size name" so we don't override existing images even if the dimensions
+ * don't match the currently defined size with the same name.
+ * To change the behavior, unset changed/mismatched sizes in the `sizes` array in image meta.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( array_key_exists( $size_name, $new_sizes ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $new_sizes[ $size_name ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -402,9 +408,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $image_meta;
</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">- // Sort the image sub-sizes in order of priority when creating them.
- // This ensures there is an appropriate sub-size the user can access immediately
- // even when there was an error and not all sub-sizes were created.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Sort the image sub-sizes in order of priority when creating them.
+ * This ensures there is an appropriate sub-size the user can access immediately
+ * even when there was an error and not all sub-sizes were created.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $priority = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'medium' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> 'large' => null,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -733,21 +741,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta['caption'] = $caption;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $iptc['2#110'][0] ) ) { // credit
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $iptc['2#110'][0] ) ) { // Credit.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['credit'] = trim( $iptc['2#110'][0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ! empty( $iptc['2#080'][0] ) ) { // creator / legacy byline
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ! empty( $iptc['2#080'][0] ) ) { // Creator / legacy byline.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['credit'] = trim( $iptc['2#080'][0] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $iptc['2#055'][0] ) && ! empty( $iptc['2#060'][0] ) ) { // created date and time
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $iptc['2#055'][0] ) && ! empty( $iptc['2#060'][0] ) ) { // Created date and time.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['created_timestamp'] = strtotime( $iptc['2#055'][0] . ' ' . $iptc['2#060'][0] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $iptc['2#116'][0] ) ) { // copyright
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $iptc['2#116'][0] ) ) { // Copyright.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['copyright'] = trim( $iptc['2#116'][0] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $iptc['2#025'][0] ) ) { // keywords array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $iptc['2#025'][0] ) ) { // Keywords array.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['keywords'] = array_values( $iptc['2#025'] );
</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">@@ -773,7 +781,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> reset_mbstring_encoding();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $meta['title'] ) && $description_length < 80 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Assume the title is stored in ImageDescription
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Assume the title is stored in ImageDescription.
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta['title'] = trim( $exif['ImageDescription'] );
</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="trunksrcwpadminincludesimportphp"></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/import.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/import.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/import.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $upload;
</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">- // Construct the object array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Construct the object array.
</ins><span class="cx" style="display: block; padding: 0 10px"> $object = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_title' => wp_basename( $upload['file'] ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => $upload['url'],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'private',
</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">- // Save the data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Save the data.
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = wp_insert_attachment( $object, $upload['file'] );
</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">@@ -136,7 +136,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array Importers with metadata for each.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_get_popular_importers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ include( ABSPATH . WPINC . '/version.php' ); // Include an unmodified $wp_version.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $locale = get_user_locale();
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_key = 'popular_importers_' . md5( $locale . $wp_version );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,7 +184,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"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // slug => name, description, plugin slug, and register_importer() slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // slug => name, description, plugin slug, and register_importer() slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'blogger' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'Blogger' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'description' => __( 'Import posts, comments, and users from a Blogger blog.' ),
</span></span></pre></div>
<a id="trunksrcwpadminincludeslisttablephp"></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/list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/list-table.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/list-table.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _get_list_table( $class, $args = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $core_classes = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //Site Admin
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Site Admin.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'WP_Posts_List_Table' => 'posts',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_Media_List_Table' => 'media',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_Terms_List_Table' => 'terms',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,12 +34,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_Plugins_List_Table' => 'plugins',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Network Admin
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Network Admin.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'WP_MS_Sites_List_Table' => 'ms-sites',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_MS_Users_List_Table' => 'ms-users',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_MS_Themes_List_Table' => 'ms-themes',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Privacy requests tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Privacy requests tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'WP_Privacy_Data_Export_Requests_List_Table' => 'privacy-data-export-requests',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WP_Privacy_Data_Removal_Requests_List_Table' => 'privacy-data-removal-requests',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></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/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/media.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function media_upload_tabs() {
</span><span class="cx" style="display: block; padding: 0 10px"> $_default_tabs = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type' => __( 'From Computer' ), // handler action suffix => tab text
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type' => __( 'From Computer' ), // Handler action suffix => tab text.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type_url' => __( 'From URL' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'gallery' => __( 'Gallery' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'library' => __( 'Media Library' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,7 +226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $caption = str_replace( array( "\r\n", "\r" ), "\n", $caption );
</span><span class="cx" style="display: block; padding: 0 10px"> $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Convert any remaining line breaks to <br>.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Convert any remaining line breaks to <br />.
</ins><span class="cx" style="display: block; padding: 0 10px"> $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Construct the attachment array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Construct the attachment array.
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment = array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_mime_type' => $type,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This should never be set as it would then overwrite an existing attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $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">- // Save the data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Save the data.
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $attachment_id ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,7 +490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This should never be set as it would then overwrite an existing attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $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">- // Save the attachment metadata
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Save the attachment metadata.
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $attachment_id ) ) {
</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"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'colors' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check callback name for 'media'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check callback name for 'media'.
</ins><span class="cx" style="display: block; padding: 0 10px"> if (
</span><span class="cx" style="display: block; padding: 0 10px"> ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -849,7 +849,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'media-form' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Upload File button was clicked
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Upload File button was clicked.
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $_FILES );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1421,8 +1421,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $form_fields[ $taxonomy ] = $t;
</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">- // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
- // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Merge default fields with their errors, so any key passed with the error
+ * (e.g. 'error', 'helps', 'value') will replace the default.
+ * The recursive merge is easily traversed with array casting:
+ * foreach ( (array) $things as $thing )
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $form_fields = array_merge_recursive( $form_fields, (array) $errors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This was formerly in image_attachment_fields_to_edit().
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1596,7 +1600,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $toggle_links = '';
</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">- $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case.
</ins><span class="cx" style="display: block; padding: 0 10px"> $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . '</span></div>' : '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1710,7 +1714,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['post_id'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $calling_post_id = absint( $_GET['post_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set.
</ins><span class="cx" style="display: block; padding: 0 10px"> $calling_post_id = $post->post_parent;
</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">@@ -1875,8 +1879,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
- // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Merge default fields with their errors, so any key passed with the error
+ * (e.g. 'error', 'helps', 'value') will replace the default.
+ * The recursive merge is easily traversed with array casting:
+ * foreach ( (array) $things as $thing )
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );
</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-admin/includes/media.php */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2132,8 +2140,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'multipart_params' => $post_params,
</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">- // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
- // when enabled. See #29602.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Currently only iOS Safari supports multiple files uploading,
+ * but iOS 7.x has a bug that prevents uploading of videos when enabled.
+ * See #29602.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> if (
</span><span class="cx" style="display: block; padding: 0 10px"> wp_is_mobile() &&
</span><span class="cx" style="display: block; padding: 0 10px"> strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2700,7 +2711,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If available type specified by media button clicked, filter by that type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If available type specified by media button clicked, filter by that type.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET['post_mime_type'] = $type;
</span><span class="cx" style="display: block; padding: 0 10px"> list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
</span></span></pre></div>
<a id="trunksrcwpadminincludesmenuphp"></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/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/menu.php 2020-01-18 00:24:57 UTC (rev 47083)
+++ trunk/src/wp-admin/includes/menu.php 2020-01-18 00:52:28 UTC (rev 47084)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,13 +208,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $menu as $order => $top ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $i++;
</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 ( 0 == $order ) { // dashboard is always shown/single
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 0 == $order ) { // Dashboard is always shown/single.
</ins><span class="cx" style="display: block; padding: 0 10px"> $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );
</span><span class="cx" style="display: block; padding: 0 10px"> $lastorder = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // if separator
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // If separator.
</ins><span class="cx" style="display: block; padding: 0 10px"> $first = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $c = $menu[ $lastorder ][4];
</span><span class="cx" style="display: block; padding: 0 10px"> $menu[ $lastorder ][4] = add_cssclass( 'menu-top-last', $c );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $first = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $mc == $i ) { // last item
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $mc == $i ) { // Last item.
</ins><span class="cx" style="display: block; padding: 0 10px"> $c = $menu[ $order ][4];
</span><span class="cx" style="display: block; padding: 0 10px"> $menu[ $order ][4] = add_cssclass( 'menu-top-last', $c );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'add_menu_classes', $menu );
</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">-uksort( $menu, 'strnatcasecmp' ); // make it all pretty
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+uksort( $menu, 'strnatcasecmp' ); // Make it all pretty.
</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 to enable custom ordering of the administration menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,21 +310,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $menu_order, $default_menu_order );
</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">-// Prevent adjacent separators
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Prevent adjacent separators.
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_menu_was_separator = false;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $menu as $id => $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === stristr( $data[4], 'wp-menu-separator' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // This item is not a separator, so falsey the toggler and do nothing
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This item is not a separator, so falsey the toggler and do nothing.
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_menu_was_separator = false;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // The previous item was a separator, so unset this one
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // The previous item was a separator, so unset this one.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( true === $prev_menu_was_separator ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $menu[ $id ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // This item is a separator, so truthy the toggler and move on
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This item is a separator, so truthy the toggler and move on.
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_menu_was_separator = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>