<!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>[41456] branches/3.7: General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.</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 { 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/41456">41456</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/41456","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-09-19 13:50:05 +0000 (Tue, 19 Sep 2017)</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'>General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.
Merges <a href="https://core.trac.wordpress.org/changeset/41434">[41434]</a> with changes to the 3.7 branch.
See <a href="https://core.trac.wordpress.org/ticket/13377">#13377</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches37srcwpadminincludesclasswppluginslisttablephp">branches/3.7/src/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#branches37srcwpadminincludestemplatephp">branches/3.7/src/wp-admin/includes/template.php</a></li>
<li><a href="#branches37srcwpadminplugineditorphp">branches/3.7/src/wp-admin/plugin-editor.php</a></li>
<li><a href="#branches37srcwpadminpluginsphp">branches/3.7/src/wp-admin/plugins.php</a></li>
<li><a href="#branches37srcwpadminthemeeditorphp">branches/3.7/src/wp-admin/theme-editor.php</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#branches37">branches/3.7/</a></li>
<li><a href="#branches37src">branches/3.7/src/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/3.7
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/3.7 2017-09-19 13:49:40 UTC (rev 41455)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/3.7 2017-09-19 13:50:05 UTC (rev 41456)
</ins><a id="branches37"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/3.7</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/3.1:18031
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.3:20543
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.4:21757
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/branches/3.8:27917,27920,27976,28073,28075-28076
-/branches/3.9:29384,29386,29408,30452
-/branches/4.2:33499
-/branches/4.3:39765
-/branches/4.6:38615
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/branches/3.8:27917,27920,27976,28073,28075-28076,41452
+/branches/3.9:29384,29386,29408,30452,41449
+/branches/4.0:41447
+/branches/4.1:41446
+/branches/4.2:33499,41445
+/branches/4.3:39765,41444
+/branches/4.4:41434
+/branches/4.5:41415-41416
+/branches/4.6:38615,41414
</ins><span class="cx" style="display: block; padding: 0 10px"> /trunk:25882-25884,25889,25891,25893,25895,25897,25899,25902,25915,25921,25923,25925,25929,25933,25954,25956,25974-25975,25977,25986,26014,26016-26017,26148-26149,26186,26304-26305,26448-26449,26734,26782,26927,27385,27872,27905-27906,27928,27964,27975,27990,28053,28113,28129,29327,29378,29381-29382,29397,29404,29631,29783,30412,30417,30425,30430,30438,30443,30458,30466,33124,33142,36083,36435,37651,38524,39645,39659,39759,39795,39807-39808,39831,39850,39956,40148,40169,40183,40400,40677,40692,40704,40723,40736,41393,41398
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><span class="cx" style="display: block; padding: 0 10px">Index: branches/3.7/src
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/3.7/src 2017-09-19 13:49:40 UTC (rev 41455)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/3.7/src 2017-09-19 13:50:05 UTC (rev 41456)
</ins><a id="branches37src"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/3.7/src</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/3.1/src:18031
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.3/src:20543
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.4/src:21757
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/branches/3.8/src:41452
</ins><span class="cx" style="display: block; padding: 0 10px"> /branches/4.2/src:33499
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.3/src:39765
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.6/src:38615
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches37srcwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/src/wp-admin/includes/class-wp-plugins-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/src/wp-admin/includes/class-wp-plugins-list-table.php 2017-09-19 13:49:40 UTC (rev 41455)
+++ branches/3.7/src/wp-admin/includes/class-wp-plugins-list-table.php 2017-09-19 13:50:05 UTC (rev 41456)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,26 +339,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $screen->in_admin( 'network' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_active ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'manage_network_plugins' ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'manage_network_plugins' ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</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"> if ( $is_active ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
</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">- $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_multisite() && current_user_can('delete_plugins') )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> } // end if $is_active
</span><span class="cx" style="display: block; padding: 0 10px"> } // end if $screen->in_admin( 'network' )
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actions['edit'] = '<a href="plugin-editor.php?file=' . urlencode( $plugin_file ) . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px"> } // end if $context
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
</span></span></pre></div>
<a id="branches37srcwpadminincludestemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/src/wp-admin/includes/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/src/wp-admin/includes/template.php 2017-09-19 13:49:40 UTC (rev 41455)
+++ branches/3.7/src/wp-admin/includes/template.php 2017-09-19 13:50:05 UTC (rev 41456)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,7 +706,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $selected = " selected='selected'";
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> $selected = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "\n\t<option value='" . esc_attr( $templates[$template] ) ."' $selected>" . esc_html( $template ) . "</option>";
</ins><span class="cx" style="display: block; padding: 0 10px"> endforeach;
</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="branches37srcwpadminplugineditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/src/wp-admin/plugin-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/src/wp-admin/plugin-editor.php 2017-09-19 13:49:40 UTC (rev 41455)
+++ branches/3.7/src/wp-admin/plugin-editor.php 2017-09-19 13:50:05 UTC (rev 41456)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,9 +86,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( $error );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ activate_plugin($file, "plugin-editor.php?file=" . urlencode( $file ) . "&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_redirect( self_admin_url("plugin-editor.php?file=" . urlencode( $file ) . "&a=te&scrollto=$scrollto") );
</ins><span class="cx" style="display: block; padding: 0 10px"> exit;
</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">@@ -175,14 +175,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <big><?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_plugin_active($plugin) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_writeable($real_file) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo sprintf(__('Editing <strong>%s</strong> (active)'), $file);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo sprintf(__('Editing <strong>%s</strong> (active)'), esc_html( $file ) );
</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">- echo sprintf(__('Browsing <strong>%s</strong> (active)'), $file);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo sprintf(__('Browsing <strong>%s</strong> (active)'), esc_html( $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_writeable($real_file) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo sprintf(__('Editing <strong>%s</strong> (inactive)'), $file);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo sprintf(__('Editing <strong>%s</strong> (inactive)'), esc_html( $file ) );
</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">- echo sprintf(__('Browsing <strong>%s</strong> (inactive)'), $file);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo sprintf(__('Browsing <strong>%s</strong> (inactive)'), esc_html( $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?></big>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</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"> 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">- <li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo $plugin_file ?></a></li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo esc_html( $plugin_file ); ?></a></li>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="branches37srcwpadminpluginsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/src/wp-admin/plugins.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/src/wp-admin/plugins.php 2017-09-19 13:49:40 UTC (rev 41455)
+++ branches/3.7/src/wp-admin/plugins.php 2017-09-19 13:50:05 UTC (rev 41456)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $action = $wp_list_table->current_action();
</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 = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$plugin = isset($_REQUEST['plugin']) ? wp_unslash( $_REQUEST['plugin'] ) : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $s = isset($_REQUEST['s']) ? urlencode($_REQUEST['s']) : '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up request URI from temporary args for screen options/paging uri's to work as expected.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,10 +37,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer('activate-plugin_' . $plugin);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $result ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'unexpected_output' == $result->get_error_code() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s");
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer('bulk-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">- $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only activate plugins which are not already active.
</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">@@ -104,9 +104,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'bulk-plugins' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['plugins'] ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugins = explode( ',', $_GET['plugins'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugins = explode( ',', wp_unslash( $_GET['plugins'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> elseif ( isset( $_POST['checked'] ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugins = (array) $_POST['checked'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugins = (array) wp_unslash( $_POST['checked'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> $plugins = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,7 +176,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer('bulk-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">- $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
</ins><span class="cx" style="display: block; padding: 0 10px"> // Do not deactivate plugins which are already deactivated.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_network_admin() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $plugins = array_filter( $plugins, 'is_plugin_active_for_network' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer('bulk-plugins');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> //$_POST = from the plugin form; $_GET = from the FTP details screen.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $plugins ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span></span></pre></div>
<a id="branches37srcwpadminthemeeditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/src/wp-admin/theme-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/src/wp-admin/theme-editor.php 2017-09-19 13:49:40 UTC (rev 41455)
+++ branches/3.7/src/wp-admin/theme-editor.php 2017-09-19 13:50:05 UTC (rev 41456)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_file = 'style.css';
</span><span class="cx" style="display: block; padding: 0 10px"> $file = $allowed_files['style.css'];
</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">- $relative_file = $file;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $relative_file = wp_unslash( $file );
</ins><span class="cx" style="display: block; padding: 0 10px"> $file = $theme->get_stylesheet_directory() . '/' . $relative_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">@@ -127,10 +127,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$description = get_file_description( $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$file_description = get_file_description( $relative_file );
</ins><span class="cx" style="display: block; padding: 0 10px"> $file_show = array_search( $file, array_filter( $allowed_files ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $description != $file_show )
- $description .= ' <span>(' . $file_show . ')</span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$description = esc_html( $file_description );
+if ( $file_description != $file_show ) {
+ $description .= ' <span>(' . esc_html( $file_show ) . ')</span>';
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php screen_icon(); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,9 +182,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'style.css' == $filename )
</span><span class="cx" style="display: block; padding: 0 10px"> echo "\t</ul>\n\t<h3>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h3>\n\t<ul>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file_description = get_file_description( $absolute_filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file_description = esc_html( get_file_description( $filename ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $file_description != basename( $filename ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $absolute_filename == $file )
</span><span class="cx" style="display: block; padding: 0 10px"> $file_description = '<span class="highlight">' . $file_description . '</span>';
</span></span></pre>
</div>
</div>
</body>
</html>