Skip to content

Commit 22c595b

Browse files
Grouped backports to the 4.3 branch.
- Posts, Post Types: Escape output within `the_meta()`. - General: Ensure bookmark query limits are numeric. - Plugins: Escape output in error messages. Merges [53958-53960] to the 4.3 branch. Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs. git-svn-id: https://develop.svn.wordpress.org/branches/4.3@53980 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 987ba91 commit 22c595b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/wp-admin/plugins.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function plugin_sandbox_scrape( $plugin ) {
411411
$invalid = validate_active_plugins();
412412
if ( !empty($invalid) )
413413
foreach ( $invalid as $plugin_file => $error )
414-
echo '<div id="message" class="error"><p>' . sprintf(__('The plugin <code>%s</code> has been <strong>deactivated</strong> due to an error: %s'), esc_html($plugin_file), $error->get_error_message()) . '</p></div>';
414+
echo '<div id="message" class="error"><p>' . sprintf(__('The plugin <code>%s</code> has been <strong>deactivated</strong> due to an error: %s'), esc_html($plugin_file), esc_html( $error->get_error_message() ) ) . '</p></div>';
415415
?>
416416

417417
<?php if ( isset($_GET['error']) ) :
@@ -437,7 +437,7 @@ function plugin_sandbox_scrape( $plugin ) {
437437
delete_transient( 'plugins_delete_result_' . $user_ID );
438438

439439
if ( is_wp_error($delete_result) ) : ?>
440-
<div id="message" class="error notice is-dismissible"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), $delete_result->get_error_message() ); ?></p></div>
440+
<div id="message" class="error notice is-dismissible"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), esc_html( $delete_result->get_error_message() ) ); ?></p></div>
441441
<?php else : ?>
442442
<div id="message" class="updated notice is-dismissible"><p><?php _e('The selected plugins have been <strong>deleted</strong>.'); ?></p></div>
443443
<?php endif; ?>

src/wp-includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function get_bookmarks( $args = '' ) {
280280
$query .= " $exclusions $inclusions $search";
281281
$query .= " ORDER BY $orderby $order";
282282
if ( $r['limit'] != -1 ) {
283-
$query .= ' LIMIT ' . $r['limit'];
283+
$query .= ' LIMIT ' . absint( $r['limit'] );
284284
}
285285

286286
$results = $wpdb->get_results( $query );

src/wp-includes/post-template.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,12 @@ function post_custom( $key = '' ) {
938938
/**
939939
* Display list of post custom fields.
940940
*
941-
* @internal This will probably change at some point...
942941
* @since 1.2.0
942+
*
943+
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
943944
*/
944945
function the_meta() {
946+
_deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
945947
if ( $keys = get_post_custom_keys() ) {
946948
echo "<ul class='post-meta'>\n";
947949
foreach ( (array) $keys as $key ) {
@@ -960,7 +962,7 @@ function the_meta() {
960962
* @param string $key Meta key.
961963
* @param string $value Meta value.
962964
*/
963-
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value );
965+
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>" . esc_html( $key ) . ":</span>" . esc_html( $value ) . "</li>\n", $key, $value );
964966
}
965967
echo "</ul>\n";
966968
}

0 commit comments

Comments
 (0)